hacklib.c NONNULL functions

A bunch of routines return a pointer which is never Null but weren't
telling the compiler that such was the case.  A couple (strsubst(),
stripchars()) were accepting Null output argument and then returning
Null, but callers had no reason to use them that way, so they've been
changed.  (upstart() could have been changed similarly; I've already
forgotten why I left it as-is.)
This commit is contained in:
PatR
2024-02-23 20:02:01 -08:00
parent 5f64dd3f1b
commit 9927e264b5
3 changed files with 64 additions and 55 deletions

View File

@@ -3460,7 +3460,7 @@ config_erradd(const char *buf)
/* if buf[] doesn't end in a period, exclamation point, or question mark,
we'll include a period (in the message, not appended to buf[]) */
punct = eos((char *) buf) - 1; /* eos(buf)-1 is valid; cast away const */
punct = c_eos((char *) buf) - 1; /* eos(buf)-1 is valid */
punct = strchr(".!?", *punct) ? "" : ".";
if (!gp.program_state.config_error_ready) {