Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/string/strnlen.c')
-rw-r--r--newlib/libc/string/strnlen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libc/string/strnlen.c b/newlib/libc/string/strnlen.c
index 92826eeb2..ed60e9371 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 (*str && n-- > 0)
+ while (n-- > 0 && *str)
str++;
return str - start;