Re: [PATCH] builtin/blame.c::prepare_lines: fix allocation size of sb-lineno

2014-02-08 Thread David Kastrup
David Kastrup d...@gnu.org writes: If we are calling xrealloc on every single line, the least we can do is get the right allocation size. Signed-off-by: David Kastrup d...@gnu.org --- This should be less contentious than the patch in

Re: [PATCH] builtin/blame.c::prepare_lines: fix allocation size of sb-lineno

2014-02-08 Thread Jeff King
On Sat, Feb 08, 2014 at 10:49:40AM +0100, David Kastrup wrote: But please note that since sb-lineno originally comes from a zeroed memory area and is passed to xrealloc, this requires that after int *p; memset(p, 0, sizeof(p)); the equivalence ((void *)p == NULL) will hold. While

Re: [PATCH] builtin/blame.c::prepare_lines: fix allocation size of sb-lineno

2014-02-08 Thread David Kastrup
Jeff King p...@peff.net writes: However, is there a reason not to use: sizeof(*sb-lineno) rather than sizeof(int) to avoid type-mismatch errors entirely (this applies both to this patch, and to any proposed rewrites using malloc). It deviates from the style of the original code by