Changeset 22:ad3d8242e8a1 in vscpl


Ignore:
Timestamp:
06/18/15 18:00:47 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/xplane/hg/vscpl' '/'>, 'public')
Message:

Fixed the reading of the variable-length size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hu/varadiistvan/scpl/io/DataStream.cc

    r10 r22  
    4545
    4646    uint8_t d = 0;
     47    unsigned shift = 0;
    4748    do {
    4849        d = readU8();
    49         length <<= 7;
    50         length |= d&0x7f;
     50        length |= static_cast<size_t>(d&0x7f)<<shift;
     51        shift += 7;
    5152    } while( (d&0x80)==0x80 );
    5253
Note: See TracChangeset for help on using the changeset viewer.