diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2015-10-17 19:44:08 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2015-10-17 19:44:08 +0000 |
commit | 597e2b8426be3b237067f364c0f7e29950f68ecc (patch) | |
tree | 124876bb72068296f0ca72039b42ec6bac79d3c6 /usr.sbin/smtpd | |
parent | 2353ce05f170bcb0a4ec400d3902781cc0f55998 (diff) |
makemap shout strip initial and trailing whitespaces using strip()
ok millert@, ok jung@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/makemap.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c index f54bd57b41c..bc5020c7fe3 100644 --- a/usr.sbin/smtpd/makemap.c +++ b/usr.sbin/smtpd/makemap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makemap.c,v 1.54 2015/10/12 07:58:19 deraadt Exp $ */ +/* $OpenBSD: makemap.c,v 1.55 2015/10/17 19:44:07 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -385,7 +385,6 @@ make_aliases(DBT *val, char *text) { struct expandnode xn; char *subrcpt; - char *endp; char *origtext; val->data = NULL; @@ -394,17 +393,11 @@ make_aliases(DBT *val, char *text) origtext = xstrdup(text, "make_aliases"); while ((subrcpt = strsep(&text, ",")) != NULL) { - /* subrcpt: strip initial whitespace. */ - while (isspace((unsigned char)*subrcpt)) - ++subrcpt; + /* subrcpt: strip initial and trailing whitespace. */ + subrcpt = strip(subrcpt); if (*subrcpt == '\0') goto error; - /* subrcpt: strip trailing whitespace. */ - endp = subrcpt + strlen(subrcpt) - 1; - while (subrcpt < endp && isspace((unsigned char)*endp)) - *endp-- = '\0'; - if (! text_to_expandnode(&xn, subrcpt)) goto error; } |