Loading...
--- Libc/Libc-391/string/FreeBSD/strnstr.c
+++ Libc/Libc-583/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.2 2001/11/07 19:55:16 obrien Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/string/strnstr.c,v 1.3 2005/02/11 21:07:51 pjd Exp $");
#include <string.h>
@@ -60,7 +60,7 @@
len = strlen(find);
do {
do {
- if ((sc = *s++) == '\0' || slen-- < 1)
+ if (slen-- < 1 || (sc = *s++) == '\0')
return (NULL);
} while (sc != c);
if (len > slen)