Skip to content

Commit 4aaae93

Browse files
author
Edward Thomson
committed
index: cast to avoid warning
1 parent 498d080 commit 4aaae93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,12 +2160,12 @@ static int read_reuc(git_index *index, const char *buffer, size_t size)
21602160

21612161
if (git__strtol64(&tmp, buffer, &endptr, 8) < 0 ||
21622162
!endptr || endptr == buffer || *endptr ||
2163-
tmp < 0) {
2163+
tmp < 0 || tmp > UINT32_MAX) {
21642164
index_entry_reuc_free(lost);
21652165
return index_error_invalid("reading reuc entry stage");
21662166
}
21672167

2168-
lost->mode[i] = tmp;
2168+
lost->mode[i] = (uint32_t)tmp;
21692169

21702170
len = (endptr + 1) - buffer;
21712171
if (size <= len) {

0 commit comments

Comments
 (0)