MCPcopy Create free account
hub / github.com/NetHack/NetHack / curses_rtrim

Function curses_rtrim

win/curses/cursmisc.c:693–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691
692
693void
694curses_rtrim(char *str)
695{
696 char *s;
697
698 for (s = str; *s != '\0'; ++s);
699 if (s > str)
700 for (--s; isspace(*s) && s > str; --s);
701 if (s == str)
702 *s = '\0';
703 else
704 *(++s) = '\0';
705}
706
707
708/* Read numbers until non-digit is encountered, and return number

Callers 1

curs_new_menu_itemFunction · 0.85

Calls 1

isspaceFunction · 0.85

Tested by

no test coverage detected