diff options
Diffstat (limited to 'newlib/libc/string/strnlen.c')
-rw-r--r-- | newlib/libc/string/strnlen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/string/strnlen.c b/newlib/libc/string/strnlen.c index ed60e9371..b9a3b5e77 100644 --- a/newlib/libc/string/strnlen.c +++ b/newlib/libc/string/strnlen.c @@ -25,7 +25,7 @@ RETURNS <<strnlen>> returns the character count or <[n]>. PORTABILITY -<<strnlen>> is a GNU extension. +<<strnlen>> is a Gnu extension. <<strnlen>> requires no supporting OS subroutines. @@ -42,7 +42,7 @@ _DEFUN (strnlen, (str, n), { _CONST char *start = str; - while (n-- > 0 && *str) + while (*str && n-- > 0) str++; return str - start; |