Commit 494448a5 by Edward Thomson

index: explicitly cast down to a size_t

Quiet down a warning from MSVC about how we're potentially losing data.
This cast is safe since we've explicitly tested that `strip_len` <=
`last_len`.
parent c3866fa8
...@@ -2475,7 +2475,7 @@ static int read_entry( ...@@ -2475,7 +2475,7 @@ static int read_entry(
if (varint_len == 0 || last_len < strip_len) if (varint_len == 0 || last_len < strip_len)
return index_error_invalid("incorrect prefix length"); return index_error_invalid("incorrect prefix length");
prefix_len = last_len - strip_len; prefix_len = last_len - (size_t)strip_len;
suffix_len = strlen(path_ptr + varint_len); suffix_len = strlen(path_ptr + varint_len);
GIT_ERROR_CHECK_ALLOC_ADD(&path_len, prefix_len, suffix_len); GIT_ERROR_CHECK_ALLOC_ADD(&path_len, prefix_len, suffix_len);
......
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