makedefs pads short rumors, epitaphs, engravings, and hallucinatory monster names with trailing underscores; strip those off */
| 64 | /* makedefs pads short rumors, epitaphs, engravings, and hallucinatory |
| 65 | monster names with trailing underscores; strip those off */ |
| 66 | staticfn void |
| 67 | unpadline(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 | |
| 82 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 83 |
no test coverage detected