mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-28 14:51:16 -04:00
+ fix crash on MS/Windows with files having an empty title (Alchemy.zim)
This commit is contained in:
parent
42c226da91
commit
ddede5e413
@ -105,10 +105,13 @@ namespace zim
|
|||||||
{
|
{
|
||||||
n = offsets.back() - offsets.front();
|
n = offsets.back() - offsets.front();
|
||||||
data.resize(n);
|
data.resize(n);
|
||||||
|
if (n > 0)
|
||||||
|
{
|
||||||
log_debug1("read " << n << " bytes of data");
|
log_debug1("read " << n << " bytes of data");
|
||||||
in.read(&(data[0]), n);
|
in.read(&(data[0]), n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ClusterImpl::write(std::ostream& out) const
|
void ClusterImpl::write(std::ostream& out) const
|
||||||
{
|
{
|
||||||
@ -133,7 +136,8 @@ namespace zim
|
|||||||
|
|
||||||
Blob ClusterImpl::getBlob(size_type n) const
|
Blob ClusterImpl::getBlob(size_type n) const
|
||||||
{
|
{
|
||||||
return Blob(const_cast<ClusterImpl*>(this), getData(n), getSize(n));
|
return getSize(n) > 0 ?
|
||||||
|
Blob(const_cast<ClusterImpl*>(this), getData(n), getSize(n)) : Blob();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClusterImpl::clear()
|
void ClusterImpl::clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user