]> diplodocus.org Git - nmh/commit
slocal.c: Alter trim() to return static array, not malloc(3).
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 10 Sep 2017 17:12:38 +0000 (18:12 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 11 Sep 2017 17:12:07 +0000 (18:12 +0100)
commit14e7f92ac37c70e4267e8602a036aa4e08a09447
treeba07900624c53bf9cf1aae15ecb7c386e96a8a8d
parent3736af69c183d472642ed17375b0970f5239e6e5
slocal.c: Alter trim() to return static array, not malloc(3).

The callers are immediately passing the return value to printf(3) for
"%s".  There's only one call per printf().  None of the callers are
bothering to free(3) the existing return value.  Return the address of
trim()'s char array, now static, instead.  Leave trim() returning NULL
when passed NULL, even though that gives NULL to print(3) for "%s".  It,
and slocal's other bugs, remain.
uip/slocal.c