summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-02-11 14:58:51 +0000
committeryexo <yexo@openttd.org>2010-02-11 14:58:51 +0000
commit6406b75b8fb1e1a15dde10534c1fe3aa235e9903 (patch)
treec7c13b96c05364cc33538173bbbba38ba95aa510 /src/network
parent07409e6741c487de7b89264da0e16a86433b37fe (diff)
downloadopenttd-6406b75b8fb1e1a15dde10534c1fe3aa235e9903.tar.xz
(svn r19094) -Codechange: don't check for NULL values before calling StrEmpty
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_udp.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 817fb40d6..2197da8d4 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -190,7 +190,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_GET_NEWGRFS)
* the current list and do not send the other data.
* The name could be an empty string, if so take the filename. */
packet_len += sizeof(c.grfid) + sizeof(c.md5sum) +
- min(strlen((f->name != NULL && !StrEmpty(f->name)) ? f->name : f->filename) + 1, (size_t)NETWORK_GRF_NAME_LENGTH);
+ min(strlen((!StrEmpty(f->name)) ? f->name : f->filename) + 1, (size_t)NETWORK_GRF_NAME_LENGTH);
if (packet_len > SEND_MTU - 4) { // 4 is 3 byte header + grf count in reply
break;
}
@@ -206,8 +206,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_GET_NEWGRFS)
char name[NETWORK_GRF_NAME_LENGTH];
/* The name could be an empty string, if so take the filename */
- strecpy(name, (in_reply[i]->name != NULL && !StrEmpty(in_reply[i]->name)) ?
- in_reply[i]->name : in_reply[i]->filename, lastof(name));
+ strecpy(name, (!StrEmpty(in_reply[i]->name)) ? in_reply[i]->name : in_reply[i]->filename, lastof(name));
this->Send_GRFIdentifier(&packet, in_reply[i]);
packet.Send_string(name);
}