Handle too long strings correctly in print_autowrap()
Submitted by: Marc van Kempen <wmbdmr@urc.tue.nl>
This commit is contained in:
parent
7439966a40
commit
1ccc95ada5
@ -174,7 +174,8 @@ void print_autowrap(WINDOW *win, unsigned char *prompt, int height, int width, i
|
||||
wsetscrreg(win, y, height);
|
||||
getyx(win, cur_y, cur_x);
|
||||
|
||||
strcpy(tempstr, prompt);
|
||||
strncpy(tempstr, prompt, MAX_LEN);
|
||||
tempstr[MAX_LEN] = '\0';
|
||||
if ((!rawmode && strstr(tempstr, "\\n") != NULL) ||
|
||||
(strchr(tempstr, '\n') != NULL)) { /* Prompt contains "\n" or '\n' */
|
||||
word = tempstr;
|
||||
|
Loading…
Reference in New Issue
Block a user