diff options
author | Brandon Casey <casey@nrlssc.navy.mil> | 2008-10-06 18:39:10 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-10-08 07:30:59 -0700 |
commit | 19d4b416f429ac2d3f4c225aaf1af8761bcb03dd (patch) | |
tree | 6675797b5e141a32cf8c4d551be3dddc5e5fc020 /builtin-merge.c | |
parent | 276328ffb87cefdc515bee5f09916aea6e0244ed (diff) | |
download | git-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.tar.gz |
Replace xmalloc/memset(0) pairs with xcalloc
Many call sites immediately initialize allocated memory with zero after
calling xmalloc. A single call to xcalloc can replace this two-call
sequence.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index 5c65a58699..dcf8987782 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -123,8 +123,7 @@ static struct strategy *get_strategy(const char *name) exit(1); } - ret = xmalloc(sizeof(struct strategy)); - memset(ret, 0, sizeof(struct strategy)); + ret = xcalloc(1, sizeof(struct strategy)); ret->name = xstrdup(name); return ret; } |