diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-23 11:46:00 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-23 11:46:00 -0600 |
commit | 9a3888489dd9e1c1100c1db8feee255ebabd86c7 (patch) | |
tree | cb1b252947b652c2b21173d83a30b48e73813a07 | |
parent | d76a897f8927de50d912b6059297303442a984aa (diff) | |
download | tdelibs-9a3888489dd9e1c1100c1db8feee255ebabd86c7.tar.gz tdelibs-9a3888489dd9e1c1100c1db8feee255ebabd86c7.zip |
Fix crash on newline assert in kddebug
-rw-r--r-- | tdecore/kdebug.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp index f87458688..05ee2c0e7 100644 --- a/tdecore/kdebug.cpp +++ b/tdecore/kdebug.cpp @@ -352,7 +352,10 @@ kdbgstream &kdbgstream::form(const char *format, ...) kdbgstream::~kdbgstream() { if (!output.isEmpty()) { 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"; } } @@ -376,7 +379,7 @@ kdbgstream& kdbgstream::operator << (TQChar ch) output += "\\x" + TQString::number( ch.unicode(), 16 ).rightJustify(2, '0'); else { output += ch; - if (ch == (QChar)'\n') flush(); + if (ch == QChar('\n')) flush(); } return *this; } @@ -415,7 +418,7 @@ kdbgstream& kdbgstream::operator << (const TQWidget* widget) return *this; } output += string; - if (output.at(output.length() -1 ) == (QChar)'\n') + if (output.at(output.length() -1 ) == QChar('\n')) { flush(); } |