diff options
| author | Damien George | 2019-12-22 22:16:32 +1100 |
|---|---|---|
| committer | Damien George | 2019-12-23 00:07:03 +1100 |
| commit | ed2be79b4930f620083256fcb5b4faf9091c9ffc (patch) | |
| tree | 321ef88e7ebba6a55b744ec377f444e8c4e1bb00 /extmod/uzlib | |
| parent | 300eb65ae75857b247fc39fbe677f6e28a7a259d (diff) | |
extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned.
The struct member "dest" should never be less than "destStart", so their
difference is never negative. Cast as such to make the comparison
explicitly unsigned, ensuring the compiler produces the correct comparison
instruction, and avoiding any compiler warnings.
Diffstat (limited to 'extmod/uzlib')
| -rw-r--r-- | extmod/uzlib/tinflate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/uzlib/tinflate.c b/extmod/uzlib/tinflate.c index b93bc1fa3..045952c75 100644 --- a/extmod/uzlib/tinflate.c +++ b/extmod/uzlib/tinflate.c @@ -464,7 +464,7 @@ static int tinf_inflate_block_data(TINF_DATA *d, TINF_TREE *lt, TINF_TREE *dt) } } else { /* catch trying to point before the start of dest buffer */ - if (offs > d->dest - d->destStart) { + if (offs > (unsigned int)(d->dest - d->destStart)) { return TINF_DATA_ERROR; } d->lzOff = -offs; |
