summaryrefslogtreecommitdiff
path: root/builtin-revert.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2007-09-15 22:32:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-19 00:42:17 (GMT)
commit182af8343c307436bb5364309aa6d4d46fa5911d (patch)
tree154c50047e12595027a0d61f54bfdd6ecd2305a5 /builtin-revert.c
parent39bd2eb56af89d43a08ba54699d9a1849ab57b39 (diff)
downloadgit-182af8343c307436bb5364309aa6d4d46fa5911d.zip
git-182af8343c307436bb5364309aa6d4d46fa5911d.tar.gz
git-182af8343c307436bb5364309aa6d4d46fa5911d.tar.bz2
Use xmemdupz() in many places.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-revert.c')
-rw-r--r--builtin-revert.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin-revert.c b/builtin-revert.c
index 499bbe7..a655c8e 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",