summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-07-22 18:56:16 +0000
committerrubidium <rubidium@openttd.org>2012-07-22 18:56:16 +0000
commitcf773911b07bfdaca081b69d7b3e80bca6761e97 (patch)
treebb11a3d583f40ef5665614708dba8fa247dfb4df
parent4dfe9379a0aae103c4fb7b526dae2d8e4295c485 (diff)
downloadopenttd-cf773911b07bfdaca081b69d7b3e80bca6761e97.tar.xz
(svn r24432) -Fix: compile warning in depend
-rw-r--r--src/depend/depend.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/depend/depend.cpp b/src/depend/depend.cpp
index 4d5ef35f3..1805e3286 100644
--- a/src/depend/depend.cpp
+++ b/src/depend/depend.cpp
@@ -922,7 +922,10 @@ int main(int argc, char *argv[])
if (size != 0) {
src = fopen(backup, "wb");
- fwrite(content, 1, size, src);
+ if (fwrite(content, 1, size, src) != (size_t)size) {
+ fprintf(stderr, "Could not write %s\n", filename);
+ exit(-2);
+ }
fclose(src);
/* Then append it to the real file. */