Browse Source

Avoid segfault in diff --stat rename output.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Sean 19 years ago committed by Junio C Hamano
parent
commit
e3008464e7
  1. 2
      diff.c

2
diff.c

@ -237,7 +237,7 @@ static char *pprint_rename(const char *a, const char *b)
if (a_midlen < 0) a_midlen = 0; if (a_midlen < 0) a_midlen = 0;
if (b_midlen < 0) b_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", sprintf(name, "%.*s{%.*s => %.*s}%s",
pfx_length, a, pfx_length, a,
a_midlen, a + pfx_length, a_midlen, a + pfx_length,

Loading…
Cancel
Save