diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-20 19:10:08 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-25 22:31:01 +0000 |
| commit | 494448a5eb723b4d47a8cc97321f7f7375150465 (patch) | |
| tree | c60b01959531de5b6a6f5d299e06be0010d3b21c /src | |
| parent | c3866fa87cf6df0d0491ea16303515bebdf56de6 (diff) | |
| download | libgit2-494448a5eb723b4d47a8cc97321f7f7375150465.tar.gz | |
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`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c index 8b753234f..7f865c2c7 100644 --- a/src/index.c +++ b/src/index.c @@ -2475,7 +2475,7 @@ static int read_entry( if (varint_len == 0 || last_len < strip_len) 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); GIT_ERROR_CHECK_ALLOC_ADD(&path_len, prefix_len, suffix_len); |
