summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-17 00:01:55 +0000
committerrubidium <rubidium@openttd.org>2007-01-17 00:01:55 +0000
commit0bd6622c2e2ff79b57cccbd98de0d244238af5f1 (patch)
treef18e7e3b826abdeb6455e527372367cad4d8b237 /src/network
parent1f3ea708c3014d7d881577d27b254c80c8201f54 (diff)
downloadopenttd-0bd6622c2e2ff79b57cccbd98de0d244238af5f1.tar.xz
(svn r8171) -Fix (FS#556): return SL_ERROR when unthreaded saves failed, to make sure we do not try to send zero-byte savegames.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_server.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 202220f34..612a9edef 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -289,6 +289,8 @@ DEF_SERVER_SEND_COMMAND(PACKET_SERVER_MAP)
file_pointer = fopen(filename, "rb");
fseek(file_pointer, 0, SEEK_END);
+ if (ftell(file_pointer) == 0) error("network savedump failed - zero sized savegame?");
+
// Now send the _frame_counter and how many packets are coming
p = NetworkSend_Init(PACKET_SERVER_MAP);
NetworkSend_uint8(p, MAP_PACKET_START);