Commit 64982f75 authored by Junio C Hamano's avatar Junio C Hamano Committed by Linus Torvalds

[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: default avatarJunio C Hamano <[email protected]>
Signed-off-by: default avatarLinus Torvalds <[email protected]>
parent 75118b13
......@@ -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;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment