diff options
author | Peter Eriksen <s022018@student.dtu.dk> | 2006-06-11 14:03:28 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-16 22:45:12 -0700 |
commit | bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e (patch) | |
tree | 52f36804599a41eafa3a020f06dbe118c6f652f9 /ident.c | |
parent | 5996ca0836e21ab4e6be0a16a615eff965f18b8b (diff) | |
download | git-bfbd0bb6ecbbbf75a5caaff6afaf5a6af8fa518e.tar.gz |
Implement safe_strncpy() as strlcpy() and use it more.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ident.c')
-rw-r--r-- | ident.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -71,10 +71,9 @@ int setup_ident(void) len = strlen(git_default_email); git_default_email[len++] = '.'; if (he && (domainname = strchr(he->h_name, '.'))) - strncpy(git_default_email + len, domainname + 1, sizeof(git_default_email) - len); + safe_strncpy(git_default_email + len, domainname + 1, sizeof(git_default_email) - len); else - strncpy(git_default_email + len, "(none)", sizeof(git_default_email) - len); - git_default_email[sizeof(git_default_email) - 1] = 0; + safe_strncpy(git_default_email + len, "(none)", sizeof(git_default_email) - len); } /* And set the default date */ datestamp(git_default_date, sizeof(git_default_date)); |