]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t-strvec: fix type mismatch in check_strvec
authorRené Scharfe <l.s.r@web.de>
Tue, 16 Jul 2024 16:14:35 +0000 (18:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jul 2024 16:30:30 +0000 (09:30 -0700)
Cast i from size_t to uintmax_t to match the format string.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/t-strvec.c

index fdb28ba220d182c796e68c9b61fd8315720f9da0..fa1a04146997c73f74b04a4e6f041f4059185761 100644 (file)
@@ -11,7 +11,8 @@
                    check_uint((vec)->nr, <=, (vec)->alloc)) { \
                        for (size_t i = 0; i < ARRAY_SIZE(expect); i++) { \
                                if (!check_str((vec)->v[i], expect[i])) { \
-                                       test_msg("      i: %"PRIuMAX, i); \
+                                       test_msg("      i: %"PRIuMAX, \
+                                                (uintmax_t)i); \
                                        break; \
                                } \
                        } \