Skip to content

Commit 8d93a11

Browse files
committed
odb: fix printf formatter for git_off_t
The fields `declared_size` and `received_bytes` of the `git_odb_stream` are both of type `git_off_t` which is defined as a signed integer. When passing these values to a printf-style string in `git_odb_stream__invalid_length`, though, we format these as PRIuZ, which is unsigned. Fix the issue by using PRIdZ instead, silencing warnings on macOS.
1 parent f0ca00e commit 8d93a11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/odb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,9 +1326,9 @@ static int git_odb_stream__invalid_length(
13261326
{
13271327
giterr_set(GITERR_ODB,
13281328
"cannot %s - "
1329-
"Invalid length. %"PRIuZ" was expected. The "
1330-
"total size of the received chunks amounts to %"PRIuZ".",
1331-
action, stream->declared_size, stream->received_bytes);
1329+
"Invalid length. %"PRIdZ" was expected. The "
1330+
"total size of the received chunks amounts to %"PRIdZ".",
1331+
action, stream->declared_size, stream->received_bytes);
13321332

13331333
return -1;
13341334
}

0 commit comments

Comments
 (0)