From 26f56bb08001e1d3c91d370cd4c5aaada0ece034 Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Wed, 30 Mar 2022 09:03:04 -0600 Subject: [PATCH] Fix indexing for platforms where char size is larger than a byte --- heatshrink_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heatshrink_encoder.c b/heatshrink_encoder.c index edf4abe..6db9f9d 100644 --- a/heatshrink_encoder.c +++ b/heatshrink_encoder.c @@ -419,7 +419,7 @@ static void do_indexing(heatshrink_encoder *hse) { * */ struct hs_index *hsi = HEATSHRINK_ENCODER_INDEX(hse); int16_t last[256]; - memset(last, 0xFF, sizeof(last)); + memset(last, -1, sizeof(last)); uint8_t * const data = hse->buffer; int16_t * const index = hsi->index;