mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Avoid possible use of uninitialized variable
Errorcode doesn't get set if duppedfd is negative. So let's just issue an error and bail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4094e6b233
commit
4bdead6ad6
1 changed files with 4 additions and 0 deletions
|
@ -813,6 +813,10 @@ void DivelogsDeWebServices::downloadFinished()
|
||||||
zip = zip_fdopen(duppedfd, 0, &errorcode);
|
zip = zip_fdopen(duppedfd, 0, &errorcode);
|
||||||
if (!zip)
|
if (!zip)
|
||||||
::close(duppedfd);
|
::close(duppedfd);
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(this, tr("Problem with download"),
|
||||||
|
tr("The archive could not be opened:\n"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
struct zip *zip = zip_open(QFile::encodeName(zipFile.fileName()), 0, &errorcode);
|
struct zip *zip = zip_open(QFile::encodeName(zipFile.fileName()), 0, &errorcode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue