From 817151e61a74241df5b5dd206d27086283f28b84 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Sat, 24 Jun 2006 16:01:25 +0200 Subject: Rename safe_strncpy() to strlcpy(). This cleans up the use of safe_strncpy() even more. Since it has the same semantics as strlcpy() use this name instead. Also move the definition from inside path.c to its own file compat/strlcpy.c, and use it conditionally at compile time, since some platforms already has strlcpy(). It's included in the same way as compat/setenv.c. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 3e077d4c6c..ec44827da4 100644 --- a/config.c +++ b/config.c @@ -280,17 +280,17 @@ int git_default_config(const char *var, const char *value) } 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; } -- cgit v1.2.3