summaryrefslogtreecommitdiff
path: root/sessreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sessreg.c')
-rw-r--r--sessreg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sessreg.c b/sessreg.c
index c574f6e..d39ac74 100644
--- a/sessreg.c
+++ b/sessreg.c
@@ -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