test-hashmap: use xsnprintf rather than snprintf
commitcbadf0ee37def5cea81fb7702941af8234dd094d
authorJeff King <peff@peff.net>
Wed, 14 Feb 2018 18:06:57 +0000 (14 13:06 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Feb 2018 18:31:09 +0000 (14 10:31 -0800)
tree82d6e0192f6aefe2ea6e5a0856dc4a00b6172d77
parentb6c4380d6e3170e21e6670248b7f332c57cb077c
test-hashmap: use xsnprintf rather than snprintf

In general, using a bare snprintf can truncate the resulting
buffer, leading to confusing results. In this case we know
that our buffer is sized large enough to accommodate our
loop, so there's no bug. However, we should use xsnprintf()
to document (and check) that assumption, and to model good
practice to people reading the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-hashmap.c