Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2007-05-01 02:22:53 +0400
committerJunio C Hamano <junkio@cox.net>2007-05-01 03:57:47 +0400
commit600682aaa12c56d55bd24233828205c43ece2ded (patch)
tree61377547211bac12beb6203ec4a203369ba1b36f /mailmap.c
parenta07157ac624b2524a059a3414e99f6f44bebc1e7 (diff)
Use strlcpy instead of strncpy in mailmap.c
strncpy does not NUL-terminate output in case of output buffer too short, and map_email prototype (and usage) does not allow for figuring out what the length of the name is. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'mailmap.c')
-rw-r--r--mailmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mailmap.c b/mailmap.c
index af187a3826..c29e4e5349 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -80,7 +80,7 @@ int map_email(struct path_list *map, const char *email, char *name, int maxlen)
free(mailbuf);
if (item != NULL) {
const char *realname = (const char *)item->util;
- strncpy(name, realname, maxlen);
+ strlcpy(name, realname, maxlen);
return 1;
}
return 0;