From: gilles Date: Sat, 17 Oct 2015 12:59:52 +0000 (+0000) Subject: our strip() function should use isspace() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2232dc042e86835593aad0c63b7dd46a0d70883;p=openbsd our strip() function should use isspace() ok jung@, ok millert@ --- diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c index a4810fd89ab..70961173512 100644 --- a/usr.sbin/smtpd/util.c +++ b/usr.sbin/smtpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.120 2015/10/12 07:58:19 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.121 2015/10/17 12:59:52 gilles Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. @@ -139,11 +139,11 @@ strip(char *s) { size_t l; - while (*s == ' ' || *s == '\t') + while (isspace((unsigned char)*s)) s++; for (l = strlen(s); l; l--) { - if (s[l-1] != ' ' && s[l-1] != '\t') + if (!isspace((unsigned char)s[l-1])) break; s[l-1] = '\0'; } @@ -196,7 +196,7 @@ mkdirs(char *path, mode_t mode) if (*path != '/') return 0; - /* make sure we don't exceed SMTPD_MAXPATHLEN */ + /* make sure we don't exceed PATH_MAX */ if (strlen(path) >= sizeof buf) return 0;