}
if (!strcmp(var, "user.name")) {
- safe_strncpy(git_default_name, value, sizeof(git_default_name));
+ strlcpy(git_default_name, value, sizeof(git_default_name));
return 0;
}
if (!strcmp(var, "user.email")) {
- safe_strncpy(git_default_email, value, sizeof(git_default_email));
+ strlcpy(git_default_email, value, sizeof(git_default_email));
return 0;
}
if (!strcmp(var, "i18n.commitencoding")) {
- safe_strncpy(git_commit_encoding, value, sizeof(git_commit_encoding));
+ strlcpy(git_commit_encoding, value, sizeof(git_commit_encoding));
return 0;
}
if (home) {
char *user_config = strdup(mkpath("%s/.gitconfig", home));
- if (access(user_config, R_OK) > 0)
+ if (!access(user_config, R_OK))
ret = git_config_from_file(fn, user_config);
free(user_config);
}