unzip.cpp: Check successful write with good()
std::ofstream::write might not throw an exception on failed write
This commit is contained in:
parent
9ddee14af1
commit
bb48d6a4dc
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue