diff options
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r-- | src/corelib/io/qiodevice.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index cc1d110252..a14c366821 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1302,7 +1302,7 @@ QByteArray QIODevice::readAll() This function reads a line of ASCII characters from the device, up to a maximum of \a maxSize - 1 bytes, stores the characters in \a data, and returns the number of bytes read. If a line could not be - read but no error ocurred, this function returns 0. If an error + read but no error occurred, this function returns 0. If an error occurs, this function returns the length of what could be read, or -1 if nothing was read. @@ -1480,10 +1480,12 @@ QByteArray QIODevice::readLine(qint64 maxSize) } else readBytes = readLine(result.data(), result.size()); - if (readBytes <= 0) + if (readBytes <= 0) { result.clear(); - else + } else { result.resize(readBytes); + result.squeeze(); + } return result; } |