summaryrefslogtreecommitdiff
path: root/htpasswd.c
diff options
context:
space:
mode:
Diffstat (limited to 'htpasswd.c')
-rw-r--r--htpasswd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/htpasswd.c b/htpasswd.c
index 8ffda29..31ac769 100644
--- a/htpasswd.c
+++ b/htpasswd.c
@@ -184,7 +184,8 @@ int main(int argc, char *argv[]) {
fprintf(stderr,"Use -c option to create new one.\n");
exit(1);
}
- strcpy(user,argv[2]);
+ strncpy(user,argv[2],sizeof(user)-1);
+ user[sizeof(user)-1] = '\0';
found = 0;
while(!(my_getline(line,MAX_STRING_LEN,f))) {