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>
This commit is contained in:
committed by
Junio C Hamano
parent
5996ca0836
commit
bfbd0bb6ec
6
config.c
6
config.c
@ -280,17 +280,17 @@ int git_default_config(const char *var, const char *value)
|
||||
}
|
||||
|
||||
if (!strcmp(var, "user.name")) {
|
||||
strncpy(git_default_name, value, sizeof(git_default_name));
|
||||
safe_strncpy(git_default_name, value, sizeof(git_default_name));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "user.email")) {
|
||||
strncpy(git_default_email, value, sizeof(git_default_email));
|
||||
safe_strncpy(git_default_email, value, sizeof(git_default_email));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "i18n.commitencoding")) {
|
||||
strncpy(git_commit_encoding, value, sizeof(git_commit_encoding));
|
||||
safe_strncpy(git_commit_encoding, value, sizeof(git_commit_encoding));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user