Commit c7f91f39 by Patrick Steinhardt

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.

(cherry picked from commit 0fcd0563)
parent 25392688
......@@ -1384,8 +1384,8 @@ static int git_odb_stream__invalid_length(
{
giterr_set(GITERR_ODB,
"cannot %s - "
"Invalid length. %"PRIdZ" was expected. The "
"total size of the received chunks amounts to %"PRIdZ".",
"Invalid length. %"PRId64" was expected. The "
"total size of the received chunks amounts to %"PRId64".",
action, stream->declared_size, stream->received_bytes);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment