Skip to content

Commit 0fcd056

Browse files
committed
odb: fix use of wrong printf formatters
The `git_odb_stream` members `declared_size` and `received_bytes` are both of the type `git_off_t`, which we usually defined to be a 64 bit signed integer. Thus, passing these members to "PRIdZ" formatters is not correct, as they are not guaranteed to accept big enough numbers. Instead, use the "PRId64" formatter, which is able to represent 64 bit signed integers.
1 parent 64138b7 commit 0fcd056

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/odb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,8 +1384,8 @@ static int git_odb_stream__invalid_length(
13841384
{
13851385
giterr_set(GITERR_ODB,
13861386
"cannot %s - "
1387-
"Invalid length. %"PRIdZ" was expected. The "
1388-
"total size of the received chunks amounts to %"PRIdZ".",
1387+
"Invalid length. %"PRId64" was expected. The "
1388+
"total size of the received chunks amounts to %"PRId64".",
13891389
action, stream->declared_size, stream->received_bytes);
13901390

13911391
return -1;

0 commit comments

Comments
 (0)