Bug 78168

Summary: files written by KOffice apps are not loadable anymore
Product: [Applications] koffice Reporter: Bernd Pol <bernd.pol>
Component: generalAssignee: KOffice Bug Wranglers <koffice-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test file which crashed kword on load
This is the corrupted file
original, uncorrupted file

Description Bernd Pol 2004-03-21 21:02:05 UTC
Version:           Unbekannt (using KDE 3.2.90 (CVS >= 20040117), compiled sources)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:          Linux (i686) release 2.4.21-99-athlon

This is on HEAD update of 2004-03-20.
Neither KWord nor KSpread can load their newly written files anymore. I get a "no valid KOffice file" error message (in German: "Öffnen der Datei /home/bp/Desktop/Test.kwd nicht möglich
Ursache: Keine gültige KOffice-Datei"), then the apps both crash upon closing the error message window.
(Sorry, no backtrace available.)
Comment 1 Bernd Pol 2004-03-21 21:04:17 UTC
Created attachment 5321 [details]
test file which crashed kword on load
Comment 2 Bernd Pol 2004-03-21 21:05:58 UTC
Created attachment 5322 [details]
This is the corrupted file

(Sorry, wrong file sent.)
Comment 3 Bernd Pol 2004-03-21 21:07:35 UTC
Created attachment 5323 [details]
original, uncorrupted file

This file was loaded into KWord, then saved as Test.kwd
Comment 4 David Faure 2004-03-21 23:19:09 UTC
CVS commit by faure: 

Ouch, logic error introduced in my last commit to this file...
Thanks for the report, sorry for the breakage.
CCMAIL: 78168-done@bugs.kde.org


  M +1 -1      kzip.cpp   1.47


--- kdelibs/kio/kio/kzip.cpp  #1.46:1.47
@@ -760,5 +760,5 @@ bool KZip::closeArchive()
 
         crc = crc32(crc, (Bytef *)buffer, bufferSize );
-        bool ok = ( device()->writeBlock( buffer, bufferSize ) != bufferSize );
+        bool ok = ( device()->writeBlock( buffer, bufferSize ) == bufferSize );
         delete[] buffer;
         if ( !ok )