mirror of https://github.com/aria2/aria2
2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed possible underflow. * src/BitfieldMan.cc (BitfieldMan::getNthBitIndex)pull/1/head
parent
1605b39a10
commit
1311ac1a47
|
@ -1,3 +1,8 @@
|
|||
2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Fixed possible underflow.
|
||||
* src/BitfieldMan.cc (BitfieldMan::getNthBitIndex)
|
||||
|
||||
2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Fixed the bug that last character in URI is not encoded.
|
||||
|
|
|
@ -174,7 +174,7 @@ size_t
|
|||
BitfieldMan::getNthBitIndex(const unsigned char bitfield, size_t nth) const
|
||||
{
|
||||
size_t index = 0;
|
||||
for(size_t bs = 7; bs >= 0; bs--) {
|
||||
for(int bs = 7; bs >= 0; --bs) {
|
||||
unsigned char mask = 1 << bs;
|
||||
if(bitfield & mask) {
|
||||
nth--;
|
||||
|
|
Loading…
Reference in New Issue