aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 3221f23..8dbfa31 100644
--- a/src/config.c
+++ b/src/config.c
@@ -162,7 +162,12 @@ static int config_parse_int(int *dest, const char *val)
static int config_parse_str(char *dest, const char *val)
{
- strncpy(dest, val, BUFSIZ);
+ int len = strlen(val);
+
+ if (len >= BUFSIZ)
+ return 0;
+
+ memcpy(dest, val, len + 1);
return 1;
}