X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-revert.c;h=a655c8ee2ab25ef778b182fbd5ff298a732c1cfd;hb=c5d236c70e043edd1033e1a132f2a594195bfd57;hp=499bbe7343a635f1c7fc024ed6a1436042dcb8ac;hpb=5bd148bfe8a4f2df8487e029cd4ee6809bc4c963;p=git.git diff --git a/builtin-revert.c b/builtin-revert.c index 499bbe734..a655c8ee2 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -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",