Skip to content

Commit db7f1d9

Browse files
committed
local transport: cast message size to int explicitly
Our progress information messages are short (and bounded by their format string), cast the length to int for callers.
1 parent 8048ba7 commit db7f1d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/transports/local.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static int local_counting(int stage, unsigned int current, unsigned int total, v
501501
if (git_buf_oom(&progress_info))
502502
return -1;
503503

504-
error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload);
504+
error = t->progress_cb(git_buf_cstr(&progress_info), (int)git_buf_len(&progress_info), t->message_cb_payload);
505505
git_buf_dispose(&progress_info);
506506

507507
return error;
@@ -588,7 +588,7 @@ static int local_download_pack(
588588
goto cleanup;
589589

590590
if (t->progress_cb &&
591-
(error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload)) < 0)
591+
(error = t->progress_cb(git_buf_cstr(&progress_info), (int)git_buf_len(&progress_info), t->message_cb_payload)) < 0)
592592
goto cleanup;
593593

594594
/* Walk the objects, building a packfile */
@@ -602,7 +602,7 @@ static int local_download_pack(
602602
goto cleanup;
603603

604604
if (t->progress_cb &&
605-
(error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload)) < 0)
605+
(error = t->progress_cb(git_buf_cstr(&progress_info), (int)git_buf_len(&progress_info), t->message_cb_payload)) < 0)
606606
goto cleanup;
607607

608608
if ((error = git_odb_write_pack(&writepack, odb, progress_cb, progress_payload)) != 0)

0 commit comments

Comments
 (0)