diff options
-rw-r--r-- | sessreg.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -201,9 +201,10 @@ sysnerr (int x, const char *s) static void safe_strncpy(char *dest, const char *src, size_t n) { - (void)strncpy(dest, src, n); - if (n > 0) + if (n > 0) { + strncpy(dest, src, n - 1); dest[n - 1] = '\0'; + } } int |