Test for strchr(3) returning NULL, not 0

MFC after: 3 days
Reported by: coccinelle
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
ngie 2016-06-08 23:17:30 +00:00
parent 05e9e0ac08
commit ab7650d5cb

View File

@ -262,7 +262,7 @@ _get_next_token(char *npp, int token)
*cp++ = '\0'; /* null-terminate token */
/* get rid of any backslash escapes */
ep = npp;
while ((np = strchr(ep, '\\')) != 0) {
while ((np = strchr(ep, '\\')) != NULL) {
if (np[1] == '\\')
np++;
strcpy(np, (ep = &np[1])); /* XXX: overlapping string copy */