[pfr] Fix binary search (#47514).
* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Handle border conditions correctly.
This commit is contained in:
parent
2a03e5d9fb
commit
351fc4b4a4
@ -1,3 +1,10 @@
|
||||
2016-03-29 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[pfr] Fix binary search (#47514).
|
||||
|
||||
* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Handle border
|
||||
conditions correctly.
|
||||
|
||||
2016-03-29 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
[pfr] Minor.
|
||||
|
@ -364,13 +364,12 @@
|
||||
else
|
||||
code = PFR_NEXT_BYTE( buff );
|
||||
|
||||
if ( code == char_code )
|
||||
goto Found_It;
|
||||
|
||||
if ( code < char_code )
|
||||
min = mid;
|
||||
else
|
||||
if ( char_code < code )
|
||||
max = mid;
|
||||
else if ( char_code > code )
|
||||
min = mid + 1;
|
||||
else
|
||||
goto Found_It;
|
||||
}
|
||||
|
||||
Fail:
|
||||
|
@ -3104,7 +3104,7 @@
|
||||
|
||||
if ( char_code < start )
|
||||
max = mid;
|
||||
else if ( char_code > start+cnt )
|
||||
else if ( char_code > start + cnt )
|
||||
min = mid + 1;
|
||||
else
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user