aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libnpass/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnpass/util.c b/src/libnpass/util.c
index 04f2a37..182f117 100644
--- a/src/libnpass/util.c
+++ b/src/libnpass/util.c
@@ -15,9 +15,9 @@ int r_mkdir(const char *path, mode_t mode)
int r;
size_t len;
char *p;
- char tmp[NAME_MAX + 1];
+ char tmp[NAME_MAX];
- strncpy(tmp, path, sizeof(tmp));
+ strncpy(tmp, path, sizeof(tmp) - 1);
len = strlen(tmp);
if (tmp[len - 1] == '/')
tmp[len - 1] = '\0';