summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2007-01-04 18:33:36 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-05 06:28:46 (GMT)
commit4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184 (patch)
treeae247b354d25e7226ac065244edf0f65f310d536
parent7c4c9f4cd9c36694ce0de5674f263585064cceec (diff)
downloadgit-4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184.zip
git-4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184.tar.gz
git-4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184.tar.bz2
Remove shadowing variable from traverse_trees()
The variable named entry is allocated using malloc() and then forgotten, it being shadowed by an automatic variable of the same name. Fixing the array size at 3 worked so far because the only caller of traverse_trees() needed only as much entries. Simply remove the shadowing varaible and we're able to traverse more than three trees and save stack space at the same time! Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--tree-walk.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/tree-walk.c b/tree-walk.c
index 14cc5ae..22f4550 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -113,7 +113,6 @@ void traverse_trees(int n, struct tree_desc *t, const char *base, traverse_callb
struct name_entry *entry = xmalloc(n*sizeof(*entry));
for (;;) {
- struct name_entry entry[3];
unsigned long mask = 0;
int i, last;