Skip to content

Commit e8b9bba

Browse files
committed
Fix case of compress_max_bits >8
1 parent fea9af5 commit e8b9bba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

supervisor/shared/translate.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ STATIC int put_utf8(char *buf, int u) {
8787
}
8888

8989
uint16_t decompress_length(const compressed_string_t *compressed) {
90-
if (compress_max_length_bits <= 8) {
91-
return 1 + (compressed->data >> (8 - compress_max_length_bits));
92-
} else {
93-
return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
94-
}
90+
#if (compress_max_length_bits <= 8)
91+
return 1 + (compressed->data >> (8 - compress_max_length_bits));
92+
#else
93+
return 1 + ((compressed->data * 256 + compressed->tail[0]) >> (16 - compress_max_length_bits));
94+
#endif
9595
}
9696

9797
char *decompress(const compressed_string_t *compressed, char *decompressed) {

0 commit comments

Comments
 (0)