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

Function unpadline

src/rumors.c:66–80  ·  view source on GitHub ↗

makedefs pads short rumors, epitaphs, engravings, and hallucinatory monster names with trailing underscores; strip those off */

Source from the content-addressed store, hash-verified

64/* makedefs pads short rumors, epitaphs, engravings, and hallucinatory
65 monster names with trailing underscores; strip those off */
66staticfn void
67unpadline(char *line)
68{
69 char *p = eos(line);
70
71 /* remove newline if still present; caller should have stripped it */
72 if (p > line && p[-1] == '\n')
73 --p;
74
75 /* remove padding */
76 while (p > line && p[-1] == '_')
77 --p;
78
79 *p = '\0';
80}
81
82DISABLE_WARNING_FORMAT_NONLITERAL
83

Callers 2

get_rnd_lineFunction · 0.85
init_CapMonsFunction · 0.85

Calls 1

eosFunction · 0.85

Tested by

no test coverage detected