From: Ralph Corderoy Date: Wed, 19 Oct 2016 09:06:44 +0000 (+0100) Subject: Replace strchr() condition with TrimSuffixC(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6651e2804863b4d1444ce5b0c0bb959416c4e0ad?ds=inline Replace strchr() condition with TrimSuffixC(). --- diff --git a/uip/slocal.c b/uip/slocal.c index 3ba3fd42..789a5977 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -423,7 +423,7 @@ usr_delivery (int fd, char *delivery, int su) int i, accept, status=1, won, vecp, next; char *field, *pattern, *action, *result, *string; char buffer[BUFSIZ], tmpbuf[BUFSIZ]; - char *cp, *vec[NVEC]; + char *vec[NVEC]; struct stat st; struct pair *p; FILE *fp; @@ -452,9 +452,7 @@ usr_delivery (int fd, char *delivery, int su) if (*buffer == '#' || *buffer == '\n') continue; - /* zap trailing newline */ - if ((cp = strchr(buffer, '\n'))) - *cp = 0; + TrimSuffixC(buffer, '\n'); /* split buffer into fields */ vecp = split (buffer, vec);