diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c index 017fdab40..55ce44d7f 100644 --- a/lib/libc/string/strncpy.c +++ b/lib/libc/string/strncpy.c @@ -17,7 +17,7 @@ strncpy(char *dest, char const *src, size_t count) { char *tmp = dest; size_t i; - for (i = 0; i < count && (*dest++ = *src++) != '\0'; i++) + for (i = 0; i++ < count && (*dest++ = *src++) != '\0'; ) ; for (; i < count; i++) *dest++ = '\0';