aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index ef16efde2..1a28c9ba0 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -864,9 +864,8 @@ int ModApiMainMenu::l_extract_zip(lua_State *L)
unsigned int bytes_read =
toread->read(read_buffer,sizeof(read_buffer));
- unsigned int bytes_written;
- if ((bytes_read < 0 ) ||
- (bytes_written = fwrite(read_buffer, 1, bytes_read, targetfile) != bytes_read))
+ if ((bytes_read == 0 ) ||
+ (fwrite(read_buffer, 1, bytes_read, targetfile) != bytes_read))
{
fclose(targetfile);
fs->removeFileArchive(fs->getFileArchiveCount()-1);