summaryrefslogtreecommitdiff
path: root/builtin/cat-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-19 07:24:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-19 07:24:41 (GMT)
commitf5f0f68d61301c3ffb2f8da84f627547e8f9a94c (patch)
tree2c4e826363e1febaaf1c7fd6187e8fa714561c5d /builtin/cat-file.c
parent502fe438bf83f5db6026c278767decf2ce6395b0 (diff)
parentca473cef9140f55d68d6758fe226ef47c216669c (diff)
downloadgit-f5f0f68d61301c3ffb2f8da84f627547e8f9a94c.zip
git-f5f0f68d61301c3ffb2f8da84f627547e8f9a94c.tar.gz
git-f5f0f68d61301c3ffb2f8da84f627547e8f9a94c.tar.bz2
Merge branch 'tb/print-size-t-with-uintmax-format'
Code preparation to replace ulong vars with size_t vars where appropriate. * tb/print-size-t-with-uintmax-format: Upcast size_t variables to uintmax_t when printing
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r--builtin/cat-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 657fe92..2ca56fd 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -99,7 +99,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
oi.sizep = &size;
if (oid_object_info_extended(the_repository, &oid, &oi, flags) < 0)
die("git cat-file: could not get object info");
- printf("%lu\n", size);
+ printf("%"PRIuMAX"\n", (uintmax_t)size);
return 0;
case 'e':
@@ -245,7 +245,7 @@ static void expand_atom(struct strbuf *sb, const char *atom, int len,
if (data->mark_query)
data->info.sizep = &data->size;
else
- strbuf_addf(sb, "%lu", data->size);
+ strbuf_addf(sb, "%"PRIuMAX , (uintmax_t)data->size);
} else if (is_atom("objectsize:disk", atom, len)) {
if (data->mark_query)
data->info.disk_sizep = &data->disk_size;