summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-25 15:40:32 +0000
committerrubidium <rubidium@openttd.org>2014-04-25 15:40:32 +0000
commit9ed12b0f07edb342aaff21c130d325fd158a9d5b (patch)
treef42aa775396b4ebda4d119f76e80a77c180936c7 /src/network
parent4227f495c51ea909707505ec2ef1c730a382965d (diff)
downloadopenttd-9ed12b0f07edb342aaff21c130d325fd158a9d5b.tar.xz
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/core/tcp_http.h2
-rw-r--r--src/network/network.cpp2
-rw-r--r--src/network/network_chat_gui.cpp2
-rw-r--r--src/network/network_server.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/network/core/tcp_http.h b/src/network/core/tcp_http.h
index 6222c7695..36520f136 100644
--- a/src/network/core/tcp_http.h
+++ b/src/network/core/tcp_http.h
@@ -96,7 +96,7 @@ public:
const char *data = NULL, int depth = 0) :
TCPConnecter(address),
callback(callback),
- url(strdup(url)),
+ url(stredup(url)),
data(data),
depth(depth)
{
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 5eefb850d..156859a40 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -653,7 +653,7 @@ void NetworkRebuildHostList()
_network_host_list.Clear();
for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) {
- if (item->manually) *_network_host_list.Append() = strdup(item->address.GetAddressAsString(false));
+ if (item->manually) *_network_host_list.Append() = stredup(item->address.GetAddressAsString(false));
}
}
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index b1a5dcb55..07224a9f1 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -391,7 +391,7 @@ struct NetworkChatWindow : public Window {
item = 0;
/* Copy the buffer so we can modify it without damaging the real data */
- pre_buf = (_chat_tab_completion_active) ? strdup(_chat_tab_completion_buf) : strdup(tb->buf);
+ pre_buf = (_chat_tab_completion_active) ? stredup(_chat_tab_completion_buf) : stredup(tb->buf);
tb_buf = ChatTabCompletionFindText(pre_buf);
tb_len = strlen(tb_buf);
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 187dfdef8..84337f5f7 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -2102,7 +2102,7 @@ uint NetworkServerKickOrBanIP(const char *ip, bool ban)
break;
}
}
- if (!contains) *_network_ban_list.Append() = strdup(ip);
+ if (!contains) *_network_ban_list.Append() = stredup(ip);
}
uint n = 0;