• Jeff King's avatar
    archive-tar: convert snprintf to xsnprintf · 9e6c1e91
    Jeff King authored
    Commit f2f02675 (archive-tar: use xsnprintf for trivial
    formatting, 2015-09-24) converted cases of "sprintf" to
    "xsnprintf", but accidentally left one as just "snprintf".
    This meant that we could silently truncate the resulting
    buffer instead of flagging an error.
    
    In practice, this is impossible to achieve, as we are
    formatting a ustar checksum, which can be at most 7
    characters. But the point of xsnprintf is to document and
    check for "should be impossible" conditions; this site was
    just accidentally mis-converted during f2f02675.
    Noticed-by: default avatarPaul Green <Paul.Green@stratus.com>
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    9e6c1e91
archive-tar.c 11.3 KB