diff options
Diffstat (limited to 'builtin-revert.c')
-rw-r--r-- | builtin-revert.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin-revert.c b/builtin-revert.c index 499bbe7343..a655c8ee2a 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", |