Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
argv created by handle_alias should be NULL terminated
author
Matthias Lederhofer
<matled@gmx.net>
Fri, 14 Jul 2006 16:37:06 +0000
(18:37 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Fri, 14 Jul 2006 18:32:39 +0000
(11:32 -0700)
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
dd4c591
)
diff --git
a/git.c
b/git.c
index 102735af6c0cfb496a04593ba466a9fbb18f693d..ee5a0e86a71119b5ac11c351a982e31c87649a15 100644
(file)
--- a/
git.c
+++ b/
git.c
@@
-133,13
+133,12
@@
static int handle_alias(int *argcp, const char ***argv)
fflush(stderr);
}
fflush(stderr);
}
+ new_argv = realloc(new_argv, sizeof(char*) *
+ (count + *argcp + 1));
/* insert after command name */
/* insert after command name */
- if (*argcp > 1) {
- new_argv = realloc(new_argv, sizeof(char*) *
- (count + *argcp));
- memcpy(new_argv + count, *argv + 1,
- sizeof(char*) * *argcp);
- }
+ memcpy(new_argv + count, *argv + 1,
+ sizeof(char*) * *argcp);
+ new_argv[count+*argcp] = NULL;
*argv = new_argv;
*argcp += count - 1;
*argv = new_argv;
*argcp += count - 1;