diff options
-rw-r--r-- | nuttx/libc/string/lib_strncpy.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/nuttx/libc/string/lib_strncpy.c b/nuttx/libc/string/lib_strncpy.c index 8a97aa67b..8dfc899ce 100644 --- a/nuttx/libc/string/lib_strncpy.c +++ b/nuttx/libc/string/lib_strncpy.c @@ -52,6 +52,7 @@ char *strncpy(char *dest, const char *src, size_t n) char *end = dest + n; /* End of dest buffer + 1 byte */ while ((*dest++ = *src++) != '\0' && dest != end); + while (dest != end) *dest++ = '\0'; return ret; } #endif |