pafra88 / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

QextReadBuffer::reserve does not reserve enough #152

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
reserve only reserves size not len + size

...
    inline char* reserve(size_t size) {
        if ( (first - buf) + len + size > capacity ) {
            size_t newCapacity = qMax(capacity, basicBlockSize);
            while (newCapacity < len + size )
                newCapacity *= 2;
            if (newCapacity > capacity) {
...

Original issue reported on code.google.com by mediatronix on 7 Nov 2012 at 10:51

GoogleCodeExporter commented 8 years ago
Thanks

Original comment by dbzhang...@gmail.com on 13 Nov 2012 at 6:01