diff options
author | rubidium <rubidium@openttd.org> | 2008-05-05 21:54:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-05 21:54:05 +0000 |
commit | 56e1178dcac0d6d7db6796d310bb098b6d664268 (patch) | |
tree | b6a7a87880602d6ced468583c62ce83fa3de9653 /src/network/network_client.cpp | |
parent | 1050f07ed13b98b4742cb77284480a49cefd90e6 (diff) | |
download | openttd-56e1178dcac0d6d7db6796d310bb098b6d664268.tar.xz |
(svn r12960) -Codechange: handle return values of (some) file system related functions.
Diffstat (limited to 'src/network/network_client.cpp')
-rw-r--r-- | src/network/network_client.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 3516baa9f..7a1492b11 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -595,7 +595,10 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) if (maptype == MAP_PACKET_NORMAL) { // We are still receiving data, put it to the file - fwrite(p->buffer + p->pos, 1, p->size - p->pos, file_pointer); + if (fwrite(p->buffer + p->pos, 1, p->size - p->pos, file_pointer) != p->size - p->pos) { + _switch_mode_errorstr = STR_NETWORK_ERR_SAVEGAMEERROR; + return NETWORK_RECV_STATUS_SAVEGAME; + } _network_join_kbytes = ftell(file_pointer) / 1024; InvalidateWindow(WC_NETWORK_STATUS_WINDOW, 0); |