Skip to content

Commit c7af393

Browse files
authored
Merge pull request libgit2#6815 from libgit2/ethomson/signed_comparedness
tree: avoid mixed signedness comparison
2 parents f5c6b6a + 99ba446 commit c7af393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libgit2/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int parse_mode(uint16_t *mode_out, const char *buffer, size_t buffer_len,
381381
if ((error = git__strntol32(&mode, buffer, buffer_len, buffer_out, 8)) < 0)
382382
return error;
383383

384-
if (mode < 0 || mode > UINT16_MAX)
384+
if (mode < 0 || (uint32_t)mode > UINT16_MAX)
385385
return -1;
386386

387387
*mode_out = mode;

0 commit comments

Comments
 (0)