Commit 80f43d1c authored by Agata Cacko's avatar Agata Cacko
Browse files

Fix KoQuaZipStore error checking

Before this commit, KoQuaZipStore would convert the number
of bytes written into a bool, and then if the bool was true
(which means if the number of bytes was higher than 0)
it would return the length of whole data as the number
of bytes written. That was the result of copying
the line across multiple commits, when the line was only
relevant a few commits ago in a KArchive (when writeData
was used and it did return bool for success).

Since now KoQuaZipStore uses write(), which returns the int,
this is the number that should be returned instead.

(See the deleted KArchive line 199 in commit 593dba2b).
parent d621189b
......@@ -112,11 +112,9 @@ qint64 KoQuaZipStore::write(const char *_data, qint64 _len)
return 0;
}
d->size += _len;
if (dd->buffer.write(_data, _len)) { // writeData returns a bool!
return _len;
}
return 0;
qint64 nwritten = dd->buffer.write(_data, _len);
d->size += nwritten;
return nwritten;
}
QStringList KoQuaZipStore::directoryList() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment