[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    PATCH: Save backtraces without trailing \0
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <ingo.kloecker () epost ! de>
Date:       2002-03-06 22:53:01
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

this tiny patch makes drkonqi save backtraces without the trailing \0 
which marks the end of the QCString m_backtrace->text().local8Bit().
In the old code this QCString was passed as QByteArray to 
QFile::writeBlock(...) and therefore saved with the trailing \0. The 
new code makes sure that the trailing \0 is not written.

Regards,
Ingo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8hp3NGnR+RTDgudgRAodyAJ9aMrFyBRexOXnSi95b3hHQQO7E/gCfZKBY
0elpkykXa0jDahQD3cZpF8Y=
=fULc
-----END PGP SIGNATURE-----

["drkonqi.patch" (text/x-diff)]

Index: debugger.cpp
===================================================================
RCS file: /home/kde/kdebase/drkonqi/debugger.cpp,v
retrieving revision 1.14
diff -u -3 -p -r1.14 debugger.cpp
--- debugger.cpp        2002/02/28 00:05:24     1.14
+++ debugger.cpp        2002/03/06 22:42:45
@@ -97,7 +97,9 @@ void KrashDebugger :: slotSave()
   if(!filename.isEmpty()) {
     QFile f(filename);
     if(f.open(IO_WriteOnly)) {
-      f.writeBlock(m_backtrace->text().local8Bit());
+      QByteArray bt = m_backtrace->text().local8Bit();
+      // don't write the trailing \0
+      f.writeBlock(bt.data(), bt.size()-1);
       f.close();
     } else {
       KMessageBox::sorry(this, i18n("Can't open file %1 for writing").arg(filename));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic