ref-filter: give uintmax_t to format with %PRIuMAX
authorJunio C Hamano <gitster@pobox.com>
Thu, 10 Jan 2019 18:15:49 +0000 (10:15 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Jan 2019 18:15:49 +0000 (10:15 -0800)
As long as we are casting to a wider type, we should cast to the one
with the correct signed-ness.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
ref-filter.c
index d8d3718abbf931b0d52a80148f3f5986516cc163..b22cab133e1b1f6a917553ffa7a03303c2cd461b 100644 (file)
@@ -897,7 +897,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
                        v->s = xstrdup(type_name(oi->type));
                else if (!strcmp(name, "objectsize:disk")) {
                        v->value = oi->disk_size;
                        v->s = xstrdup(type_name(oi->type));
                else if (!strcmp(name, "objectsize:disk")) {
                        v->value = oi->disk_size;
-                       v->s = xstrfmt("%"PRIuMAX, (intmax_t)oi->disk_size);
+                       v->s = xstrfmt("%"PRIuMAX, (uintmax_t)oi->disk_size);
                } else if (!strcmp(name, "objectsize")) {
                        v->value = oi->size;
                        v->s = xstrfmt("%lu", oi->size);
                } else if (!strcmp(name, "objectsize")) {
                        v->value = oi->size;
                        v->s = xstrfmt("%lu", oi->size);