summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 143c89b)
raw | patch | inline | side by side (parent: 143c89b)
author | Peter Eriksen <s022018@student.dtu.dk> | |
Tue, 25 Jul 2006 07:30:18 +0000 (09:30 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 25 Jul 2006 21:08:09 +0000 (14:08 -0700) |
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-add.c | patch | blob | history | |
builtin-rm.c | patch | blob | history | |
combine-diff.c | patch | blob | history |
diff --git a/builtin-add.c b/builtin-add.c
index 2d256981733345f4a430e11812b6851f0351aabd..3a73a173f729e0ca75e650779773316e8ae3fe98 100644 (file)
--- a/builtin-add.c
+++ b/builtin-add.c
for (specs = 0; pathspec[specs]; specs++)
/* nothing */;
- seen = xmalloc(specs);
- memset(seen, 0, specs);
+ seen = xcalloc(specs, 1);
src = dst = dir->entries;
i = dir->nr;
diff --git a/builtin-rm.c b/builtin-rm.c
index 5deb81171996029b31da14109c408ffba33f7957..bb810ba41ae23c9dc4c38fbb0fa7883a33d43524 100644 (file)
--- a/builtin-rm.c
+++ b/builtin-rm.c
seen = NULL;
for (i = 0; pathspec[i] ; i++)
/* nothing */;
- seen = xmalloc(i);
- memset(seen, 0, i);
+ seen = xcalloc(i, 1);
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
diff --git a/combine-diff.c b/combine-diff.c
index 1bc1484645b4021ee71415f3b3ed44e4c88030d6..919112bba9271a8e3903b06946cf91036411f1a4 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
/* deleted file */
result_size = 0;
elem->mode = 0;
- result = xmalloc(1);
- result[0] = 0;
+ result = xcalloc(1, 1);
}
if (0 <= fd)
close(fd);