diff options
Diffstat (limited to 'newlib/libc/string/strnlen.c')
-rw-r--r-- | newlib/libc/string/strnlen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/string/strnlen.c b/newlib/libc/string/strnlen.c index ed60e9371..92826eeb2 100644 --- a/newlib/libc/string/strnlen.c +++ b/newlib/libc/string/strnlen.c @@ -42,7 +42,7 @@ _DEFUN (strnlen, (str, n), { _CONST char *start = str; - while (n-- > 0 && *str) + while (*str && n-- > 0) str++; return str - start; |