Loading...
string/FreeBSD/strnstr.c Libc-583 Libc-391.2.7
--- Libc/Libc-583/string/FreeBSD/strnstr.c
+++ Libc/Libc-391.2.7/string/FreeBSD/strnstr.c
@@ -39,7 +39,7 @@
 static char sccsid[] = "@(#)strstr.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/string/strnstr.c,v 1.3 2005/02/11 21:07:51 pjd Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/string/strnstr.c,v 1.2 2001/11/07 19:55:16 obrien Exp $");
 
 #include <string.h>
 
@@ -60,7 +60,7 @@
 		len = strlen(find);
 		do {
 			do {
-				if (slen-- < 1 || (sc = *s++) == '\0')
+				if ((sc = *s++) == '\0' || slen-- < 1)
 					return (NULL);
 			} while (sc != c);
 			if (len > slen)