unzip.cpp: Check successful write with good()

std::ofstream::write might not throw an exception on failed write
This commit is contained in:
Xavier Del Campo Romero 2025-01-09 21:55:50 +01:00
parent 9ddee14af1
commit bb48d6a4dc
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2

View file

@ -97,6 +97,12 @@ int unzip::extract(const std::string &path) const
try
{
out.write(buf, n);
if (!out.good())
{
GfLogError("Failed to write %d bytes\n", n);
return -1;
}
}
catch (const std::ios_base::failure &failure)
{