Skip to content

Commit 57e70ad

Browse files
authored
Merge pull request #4553 from jepler/decompress-length-fix
decompress: Fix decompression when length takes 7 bits
2 parents 27d8832 + 234fa2a commit 57e70ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supervisor/shared/translate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ uint16_t decompress_length(const compressed_string_t *compressed) {
8686
char *decompress(const compressed_string_t *compressed, char *decompressed) {
8787
uint8_t this_byte = compress_max_length_bits / 8;
8888
uint8_t this_bit = 7 - compress_max_length_bits % 8;
89-
uint8_t b = (&compressed->data)[this_byte];
89+
uint8_t b = (&compressed->data)[this_byte] << (compress_max_length_bits % 8);
9090
uint16_t length = decompress_length(compressed);
9191

9292
// Stop one early because the last byte is always NULL.

0 commit comments

Comments
 (0)