summaryrefslogtreecommitdiff
path: root/show-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-04-17 20:31:40 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 20:31:40 -0700
commit64982f75109dfc42967773f35301f2dcd30a1a9f (patch)
tree12c432b101d918e193bd01c259c56046907b0ba9 /show-diff.c
parent75118b13bc8187c629886b108929f996c47daf01 (diff)
downloadgit-64982f75109dfc42967773f35301f2dcd30a1a9f.tar.gz
[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>
Diffstat (limited to 'show-diff.c')
-rw-r--r--show-diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/show-diff.c b/show-diff.c
index 8a66e59cf5..36afb3cc91 100644
--- a/show-diff.c
+++ b/show-diff.c
@@ -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;