Fix crash on newline assert in kddebug

pull/16/head
Timothy Pearson 14 years ago
parent d76a897f89
commit 9a3888489d

@ -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