aboutsummaryrefslogtreecommitdiffstats
path: root/src/routines.c
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-07-04 17:35:53 +0000
committerJoursoir <chat@joursoir.net>2021-07-04 17:35:53 +0000
commitd141b72593a37bc6c78db39d218f61965373b5c7 (patch)
treeadd4ccd1483d854d3aedc14cc873e8f8c77f5071 /src/routines.c
parenta2015eefbf85403b547f0018a13596bf7c30d164 (diff)
downloadlock-password-d141b72593a37bc6c78db39d218f61965373b5c7.tar.gz
lock-password-d141b72593a37bc6c78db39d218f61965373b5c7.tar.bz2
lock-password-d141b72593a37bc6c78db39d218f61965373b5c7.zip
routines: null-terminate a generated password
Diffstat (limited to 'src/routines.c')
-rw-r--r--src/routines.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/routines.c b/src/routines.c
index 7a434f7..09916aa 100644
--- a/src/routines.c
+++ b/src/routines.c
@@ -183,6 +183,7 @@ char *gen_password(int length)
for(i = 0; i < length; i++)
password[i] = allowed_chars[rand() % NUMBER_ALLOWED_CHARS];
+ password[i] = '\0';
return password;
}