Teach diff -a as shorthand for --text
[gitweb.git] / ident.c
diff --git a/ident.c b/ident.c
index 7c81fe8d8bfc4c76324277dc7daa39c76ed12cd3..efec97ffd0a9f3aa6573f3476c749d38d6fc388c 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -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);
+                       strlcpy(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;
+                       strlcpy(git_default_email + len, "(none)", sizeof(git_default_email) - len);
        }
        /* And set the default date */
        datestamp(git_default_date, sizeof(git_default_date));