From 6cecd4280ac9108889bfda515d20db7ed59970e5 Mon Sep 17 00:00:00 2001 From: Vadim Vygonets Date: Wed, 13 May 2015 16:10:20 +0200 Subject: [PATCH] Fix signed/unsigned comparison --- heatshrink_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heatshrink_encoder.c b/heatshrink_encoder.c index 9dd160d..89c89ea 100644 --- a/heatshrink_encoder.c +++ b/heatshrink_encoder.c @@ -533,7 +533,7 @@ static uint16_t find_longest_match(heatshrink_encoder *hse, uint16_t start, pos = hsi->index[pos]; } #else - for (int16_t pos=end - 1; pos >= start; pos--) { + for (int16_t pos=end - 1; pos >= (int16_t)start; pos--) { uint8_t * const pospoint = &buf[pos]; if ((pospoint[match_maxlen] == needlepoint[match_maxlen]) && (*pospoint == *needlepoint)) {