mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
pass the buffer size to QByteArray constructor in qt_prettyDebug() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
296bac0dcf
commit
c959f9236f
1 changed files with 11 additions and 8 deletions
|
@ -74,14 +74,17 @@ static inline QByteArray qt_prettyDebug(const char *data, int len, int maxSize)
|
|||
char c = data[i];
|
||||
if (isprint(int(uchar(c)))) {
|
||||
out += c;
|
||||
} else switch (c) {
|
||||
case '\n': out += "\\n"; break;
|
||||
case '\r': out += "\\r"; break;
|
||||
case '\t': out += "\\t"; break;
|
||||
default:
|
||||
QSTACKARRAY(char, buf, 5);
|
||||
::snprintf(buf, sizeof(buf), "\\%3o", c);
|
||||
out += QByteArray(buf);
|
||||
} else {
|
||||
switch (c) {
|
||||
case '\n': out += "\\n"; break;
|
||||
case '\r': out += "\\r"; break;
|
||||
case '\t': out += "\\t"; break;
|
||||
default: {
|
||||
QSTACKARRAY(char, snprintfbuf, 5);
|
||||
::snprintf(snprintfbuf, sizeof(snprintfbuf), "\\%3o", c);
|
||||
out += QByteArray(snprintfbuf, sizeof(snprintfbuf) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue