Fix buffer underrun in curses
This commit is contained in:
@@ -691,7 +691,8 @@ curses_rtrim(char *str)
|
|||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
for (s = str; *s != '\0'; ++s);
|
for (s = str; *s != '\0'; ++s);
|
||||||
for (--s; isspace(*s) && s > str; --s);
|
if (s > str)
|
||||||
|
for (--s; isspace(*s) && s > str; --s);
|
||||||
if (s == str)
|
if (s == str)
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user