aboutsummaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2007-09-16 00:32:36 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-18 17:42:17 -0700
commit182af8343c307436bb5364309aa6d4d46fa5911d (patch)
tree154c50047e12595027a0d61f54bfdd6ecd2305a5 /fast-import.c
parent39bd2eb56af89d43a08ba54699d9a1849ab57b39 (diff)
downloadgit-182af8343c307436bb5364309aa6d4d46fa5911d.tar.gz
git-182af8343c307436bb5364309aa6d4d46fa5911d.tar.xz
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 'fast-import.c')
-rw-r--r--fast-import.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fast-import.c b/fast-import.c
index e2a483470..f9906586e 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1864,9 +1864,7 @@ static void file_change_cr(struct branch *b, int rename)
endp = strchr(s, ' ');
if (!endp)
die("Missing space after source: %s", command_buf.buf);
- s_uq = xmalloc(endp - s + 1);
- memcpy(s_uq, s, endp - s);
- s_uq[endp - s] = 0;
+ s_uq = xmemdupz(s, endp - s);
}
s = s_uq;