yn_function (trunk only)
Explicitly truncate the query prompt string to QBUFSZ-1 characters. For tty and Amiga, no longer include the choices and default within that length limit; use a bigger buffer to hold them along with the prompt. [See cvs log for doc/window.doc for more details.]
This commit is contained in:
@@ -4963,8 +4963,11 @@ char NetHackQtBind::qt_yn_function(const char *question, const char *choices, CH
|
||||
// anything beyond <esc> is hidden
|
||||
*cb = '\0';
|
||||
}
|
||||
Sprintf(message, "%s [%s] ", question, choicebuf);
|
||||
if (def) Sprintf(eos(message), "(%c) ", def);
|
||||
(void)strncpy(message, question, QBUFSZ-1);
|
||||
message[QBUFSZ-1] = '\0';
|
||||
Sprintf(eos(message), " [%s]", choicebuf);
|
||||
if (def) Sprintf(eos(message), " (%c)", def);
|
||||
Strcat(message, " ");
|
||||
// escape maps to 'q' or 'n' or default, in that order
|
||||
yn_esc_map = (index(choices, 'q') ? 'q' :
|
||||
(index(choices, 'n') ? 'n' : def));
|
||||
|
||||
Reference in New Issue
Block a user