--- a/src/network/network_udp.cpp Sat Jan 13 14:48:47 2007 +0000
+++ b/src/network/network_udp.cpp Sat Jan 13 15:00:16 2007 +0000
@@ -238,7 +238,7 @@
* 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 && strlen(f->name) > 0) ? f->name : f->filename) + 1, (size_t)NETWORK_GRF_NAME_LENGTH);
+ min(strlen((f->name != NULL && !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;
}
@@ -254,7 +254,7 @@
char name[NETWORK_GRF_NAME_LENGTH];
/* The name could be an empty string, if so take the filename */
- ttd_strlcpy(name, (in_reply[i]->name != NULL && strlen(in_reply[i]->name) > 0) ?
+ ttd_strlcpy(name, (in_reply[i]->name != NULL && !StrEmpty(in_reply[i]->name)) ?
in_reply[i]->name : in_reply[i]->filename, sizeof(name));
this->Send_GRFIdentifier(packet, in_reply[i]);
NetworkSend_string(packet, name);
@@ -395,7 +395,7 @@
/* An empty name is not possible under normal circumstances
* and causes problems when showing the NewGRF list. */
- if (strlen(name) == 0) continue;
+ if (StrEmpty(name)) continue;
/* Finds the fake GRFConfig for the just read GRF ID and MD5sum tuple.
* If it exists and not resolved yet, then name of the fake GRF is