mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
[PATCH] (resend) show-diff.c off-by-one fix
The patch to introduce shell safety to show-diff has an off-by-one error. Here is an fix. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
75118b13bc
commit
64982f7510
|
@ -27,8 +27,8 @@ static char *sq_expand(char *src)
|
|||
int cnt, c;
|
||||
char *cp;
|
||||
|
||||
/* count single quote characters */
|
||||
for (cnt = 0, cp = src; *cp; cnt++, cp++)
|
||||
/* count bytes needed to store the quoted string. */
|
||||
for (cnt = 1, cp = src; *cp; cnt++, cp++)
|
||||
if (*cp == '\'')
|
||||
cnt += 3;
|
||||
|
||||
|
|
Loading…
Reference in a new issue