mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
nfsnprintf() wraps vsnprintf(3) and reports attempts to use too small a buffer using BUG(), just like xsnprintf(). It has an extra check that makes sure the buffer size (converted to int) is positive. vsnprintf(3) is supposed to handle a buffer size of zero or bigger than INT_MAX just fine, so this extra comparison doesn't make us any safer. If a platform has a broken implementation, we'd need to work around it in our compat code. Call xsnprintf() instead to reduce code duplication and make the caller slightly more readable by using this more common helper. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
36 KiB
36 KiB