Fix crash on newline assert in kddebug

(cherry picked from commit 9a3888489d)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 73036b1ca2
commit 0c897d4fbf

@ -352,7 +352,10 @@ kdbgstream &kdbgstream::form(const char *format, ...)
kdbgstream::~kdbgstream() { kdbgstream::~kdbgstream() {
if (!output.isEmpty()) { if (!output.isEmpty()) {
fprintf(stderr, "ASSERT: debug output not ended with \\n\n"); fprintf(stderr, "ASSERT: debug output not ended with \\n\n");
fprintf(stderr, "%s", kdBacktrace().latin1()); TQString backtrace = kdBacktrace();
if (backtrace.ascii() != NULL) {
fprintf(stderr, "%s", backtrace.latin1());
}
*this << "\n"; *this << "\n";
} }
} }
@ -376,7 +379,7 @@ kdbgstream& kdbgstream::operator << (TQChar ch)
output += "\\x" + TQString::number( ch.unicode(), 16 ).rightJustify(2, '0'); output += "\\x" + TQString::number( ch.unicode(), 16 ).rightJustify(2, '0');
else { else {
output += ch; output += ch;
if (ch == (QChar)'\n') flush(); if (ch == QChar('\n')) flush();
} }
return *this; return *this;
} }
@ -415,7 +418,7 @@ kdbgstream& kdbgstream::operator << (const TQWidget* widget)
return *this; return *this;
} }
output += string; output += string;
if (output.at(output.length() -1 ) == (QChar)'\n') if (output.at(output.length() -1 ) == QChar('\n'))
{ {
flush(); flush();
} }

Loading…
Cancel
Save