diff options
-rw-r--r-- | extra/config/confdata.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extra/config/confdata.c b/extra/config/confdata.c index 61c91c248..94c63c0e8 100644 --- a/extra/config/confdata.c +++ b/extra/config/confdata.c @@ -814,7 +814,8 @@ next: fclose(out); if (*tmpname) { - dirname = strndup(basename, strlen(basename) + 4); + dirname = malloc(strlen(basename) + 4 + 1); + strcpy(dirname, basename); strcat(dirname, ".old"); rename(newname, dirname); free(dirname); |