cvsserver: add comments about database schema/usage
[gitweb.git] / pretty.c
index dc57e5b3296b0e580d6db62c3556f0ff3d52307f..8b1ea9ffad2a0b5c5cb5c15cc5057a8a7132da07 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -550,8 +550,10 @@ static size_t format_person_part(struct strbuf *sb, char part,
        mail_end = s.mail_end;
 
        if (part == 'N' || part == 'E') { /* mailmap lookup */
-               strlcpy(person_name, name_start, name_end - name_start + 1);
-               strlcpy(person_mail, mail_start, mail_end - mail_start + 1);
+               snprintf(person_name, sizeof(person_name), "%.*s",
+                        (int)(name_end - name_start), name_start);
+               snprintf(person_mail, sizeof(person_mail), "%.*s",
+                        (int)(mail_end - mail_start), mail_start);
                mailmap_name(person_mail, sizeof(person_mail), person_name, sizeof(person_name));
                name_start = person_name;
                name_end = name_start + strlen(person_name);