summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/string/strnstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/string/strnstr.c b/lib/libc/string/strnstr.c
index 6983507..749c43b 100644
--- a/lib/libc/string/strnstr.c
+++ b/lib/libc/string/strnstr.c
@@ -60,7 +60,7 @@ strnstr(s, find, slen)
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)
OpenPOWER on IntegriCloud