Fix debug output when enabling QABSTRACTSOCKET_DEBUG.

Some calls pass len=32, so garbage was shown when maxlen (readBytes) is smaller.

Change-Id: I97e61dcdf5a0db032317c57afb4bfb406437d8d5
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
This commit is contained in:
David Faure 2014-05-03 00:35:12 +02:00 committed by The Qt Project
parent d915432c23
commit 344562aff7

View File

@ -509,7 +509,7 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxLength)
{
if (!data) return "(null)";
QByteArray out;
for (int i = 0; i < len; ++i) {
for (int i = 0; i < qMin(len, maxLength); ++i) {
char c = data[i];
if (isprint(int(uchar(c)))) {
out += c;