summaryrefslogtreecommitdiff
path: root/builtin.h
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2007-06-16 18:37:39 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-06-16 17:55:44 -0700
commitc927e6c69b50877e116340671ed35aaf6d3a8f49 (patch)
treec88223f32daf48d3a04ae50aaf9f9495ec8de6f9 /builtin.h
parentExtend --pretty=oneline to cover the first paragraph, (diff)
downloadtgif-c927e6c69b50877e116340671ed35aaf6d3a8f49.tar.xz
Fix ALLOC_GROW off-by-one
The ALLOC_GROW macro will never let us fill the array completely, instead allocating an extra chunk if that would be the case. This is because the 'nr' argument was originally treated as "how much we do have now" instead of "how much do we want". The latter makes much more sense because you can grow by more than one item. This off-by-one never resulted in an error because it meant we were overly conservative about when to allocate. Any callers which passed "how much we have now" need to be updated, or they will fail to allocate enough. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin.h')
0 files changed, 0 insertions, 0 deletions