summaryrefslogtreecommitdiff
path: root/convert.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 /convert.c
parent39bd2eb56af89d43a08ba54699d9a1849ab57b39 (diff)
downloadgit-182af8343c307436bb5364309aa6d4d46fa5911d.tar.gz
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 'convert.c')
-rw-r--r--convert.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/convert.c b/convert.c
index 508d30b2f1..79c9df2e91 100644
--- a/convert.c
+++ b/convert.c
@@ -323,13 +323,8 @@ static int read_convert_config(const char *var, const char *value)
if (!strncmp(drv->name, name, namelen) && !drv->name[namelen])
break;
if (!drv) {
- char *namebuf;
drv = xcalloc(1, sizeof(struct convert_driver));
- namebuf = xmalloc(namelen + 1);
- memcpy(namebuf, name, namelen);
- namebuf[namelen] = 0;
- drv->name = namebuf;
- drv->next = NULL;
+ drv->name = xmemdupz(name, namelen);
*user_convert_tail = drv;
user_convert_tail = &(drv->next);
}