prefer memcpy to strcpy
[gitweb.git] / mailmap.c
index 9e9589730fa44c94d122dfdb50172baf95e2578d..f4a0f1cf27bf0a10626cc5b1fd628e12cbda3a7e 100644 (file)
--- a/mailmap.c
+++ b/mailmap.c
@@ -162,11 +162,10 @@ static void read_mailmap_line(struct string_list *map, char *buffer,
                        char *cp;
 
                        free(*repo_abbrev);
-                       *repo_abbrev = xmalloc(len);
 
                        for (cp = buffer + abblen; isspace(*cp); cp++)
                                ; /* nothing */
-                       strcpy(*repo_abbrev, cp);
+                       *repo_abbrev = xstrdup(cp);
                }
                return;
        }