diff options
author | Sean <seanlkml@sympatico.ca> | 2006-05-23 02:36:34 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-23 03:00:38 +0200 |
commit | e3008464e70d25b4926b97b1f86951d7a3cb938d (patch) | |
tree | d4dd1d5b3af849e6f4d83638d16bad9be6825dd8 /diff.c | |
parent | Tutorial #2: broken link fix. (diff) | |
download | git-e3008464e70d25b4926b97b1f86951d7a3cb938d.tar.xz git-e3008464e70d25b4926b97b1f86951d7a3cb938d.zip |
Avoid segfault in diff --stat rename output.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -237,7 +237,7 @@ static char *pprint_rename(const char *a, const char *b) if (a_midlen < 0) a_midlen = 0; if (b_midlen < 0) b_midlen = 0; - name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7); + name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7); sprintf(name, "%.*s{%.*s => %.*s}%s", pfx_length, a, a_midlen, a + pfx_length, |