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 <redacted>
Signed-off-by: Linus Torvalds <redacted>
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;