Fix buffer underrun in curses

This commit is contained in:
Pasi Kallinen
2020-11-15 13:22:45 +02:00
parent 289c8d654d
commit 7cfc5a7142

View File

@@ -691,7 +691,8 @@ curses_rtrim(char *str)
char *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)
*s = '\0';
else