projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6715c42
)
Fix invalid check for fread error on extracting zip
author
sapier
<Sapier at GMX dot net>
Fri, 7 Feb 2014 20:29:31 +0000
(21:29 +0100)
committer
sapier
<Sapier at GMX dot net>
Fri, 7 Feb 2014 20:29:31 +0000
(21:29 +0100)
src/script/lua_api/l_mainmenu.cpp
patch
|
blob
|
history
diff --git
a/src/script/lua_api/l_mainmenu.cpp
b/src/script/lua_api/l_mainmenu.cpp
index ef16efde2a6a32100ade6080227e0ac8cff1b6cb..1a28c9ba098a8381d7a104c1ebf709029fe6b2e7 100644
(file)
--- 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);