diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-23 11:46:00 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-02 19:05:15 +0200 |
commit | 0c897d4fbff9ae2676f317605aacc32dbb063d39 (patch) | |
tree | c6347343409fb95114a8a2e33f8fcf9b1ccf9935 /kdecore | |
parent | 73036b1ca2d49e5f5fcef8979bbb3ec39d10c17e (diff) | |
download | tdelibs-0c897d4fbff9ae2676f317605aacc32dbb063d39.tar.gz tdelibs-0c897d4fbff9ae2676f317605aacc32dbb063d39.zip |
Fix crash on newline assert in kddebug
(cherry picked from commit 9a3888489dd9e1c1100c1db8feee255ebabd86c7)
Diffstat (limited to 'kdecore')
-rw-r--r-- | kdecore/kdebug.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kdecore/kdebug.cpp b/kdecore/kdebug.cpp index 4985e51a3..e673d4173 100644 --- a/kdecore/kdebug.cpp +++ b/kdecore/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(); } |