# HG changeset patch # User jcdutton # Date 1053281009 0 # Node ID a8b35f4c63b95b61e3109ed0a6d34b9119a313e0 # Parent 534f17c79e4a491a0d7a1cdcdc1a2b384a657b62 Minor bugfix for getbits. It did not actually change how in functioned, but it will have effected get16bits and get32bits future functions. diff -r 534f17c79e4a -r a8b35f4c63b9 nav_read.c --- a/nav_read.c Fri May 16 10:17:11 2003 +0000 +++ b/nav_read.c Sun May 18 18:03:29 2003 +0000 @@ -69,6 +69,11 @@ byte = byte >> (8 - number_of_bits); result = byte; state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */ + if (state->bit_position == 8) { + state->bit_position = 0; + state->byte_position++; + state->byte = state->start[state->byte_position]; + } number_of_bits = 0; } }