Fix buffer underrun in curses

This commit is contained in:
Pasi Kallinen
2020-11-15 13:22:45 +02:00
parent 289c8d654d
commit 7cfc5a7142
+1
View File
@@ -691,6 +691,7 @@ curses_rtrim(char *str)
char *s; char *s;
for (s = str; *s != '\0'; ++s); for (s = str; *s != '\0'; ++s);
if (s > str)
for (--s; isspace(*s) && s > str; --s); for (--s; isspace(*s) && s > str; --s);
if (s == str) if (s == str)
*s = '\0'; *s = '\0';