From 860f7931d510246256a6c1b3d90844033d120505 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 15 Feb 2022 14:08:28 -0600 Subject: [PATCH] Fix case of compress_max_bits >8 --- supervisor/shared/translate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index a14fa5c728..674df7579a 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -87,11 +87,11 @@ STATIC int put_utf8(char *buf, int u) { } uint16_t decompress_length(const compressed_string_t *compressed) { - if (compress_max_length_bits <= 8) { - return 1 + (compressed->data >> (8 - compress_max_length_bits)); - } else { - return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits)); - } + #if (compress_max_length_bits <= 8) + return 1 + (compressed->data >> (8 - compress_max_length_bits)); + #else + return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits)); + #endif } char *decompress(const compressed_string_t *compressed, char *decompressed) {