strcmp returns an int not a ptr so don't compare to NULL

This commit is contained in:
christos 2000-11-15 19:54:12 +00:00
parent e6fa7f2fc8
commit 6941b7e8a4

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr.c,v 1.9 2000/01/14 06:53:48 mjl Exp $ */ /* $NetBSD: subr.c,v 1.10 2000/11/15 19:54:12 christos Exp $ */
/* /*
* Copyright (c) 1980, 1993 * Copyright (c) 1980, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: subr.c,v 1.9 2000/01/14 06:53:48 mjl Exp $"); __RCSID("$NetBSD: subr.c,v 1.10 2000/11/15 19:54:12 christos Exp $");
#endif /* not lint */ #endif /* not lint */
#include <ctype.h> #include <ctype.h>
@ -388,7 +388,7 @@ wordvcmp(wordv1, wordc, wordv2)
for (i = 0; i < wordc; i++){ for (i = 0; i < wordc; i++){
if (wordv1[i] == NULL || wordv2[i] == NULL) if (wordv1[i] == NULL || wordv2[i] == NULL)
return(-1); return(-1);
if ((back = strcmp(wordv1[i], wordv2[i])) != NULL) if ((back = strcmp(wordv1[i], wordv2[i])) != 0)
return(back); return(back);
} }
return(0); /* they are equal */ return(0); /* they are equal */