gitweb: Read repo config using 'git config -z -l'
[gitweb.git] / builtin-revert.c
index eafafbc333e784aa2c49ee9d360077cb212797c6..e855b206cf030c5e907d94b171fbbfe3b9601a2b 100644 (file)
@@ -168,9 +168,7 @@ static void set_author_ident_env(const char *message)
                        char *line, *pend, *email, *timestamp;
 
                        p += 7;
-                       line = xmalloc(eol + 1 - p);
-                       memcpy(line, p, eol - p);
-                       line[eol - p] = '\0';
+                       line = xmemdupz(p, eol - p);
                        email = strchr(line, '<');
                        if (!email)
                                die ("Could not extract author email from %s",