summaryrefslogtreecommitdiff
path: root/src/company_cmd.cpp
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/company_cmd.cpp
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/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 97095d3c9..d83df30af 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -1114,7 +1114,7 @@ CommandCost CmdRenameCompany(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
if (flags & DC_EXEC) {
Company *c = Company::Get(_current_company);
free(c->name);
- c->name = reset ? NULL : strdup(text);
+ c->name = reset ? NULL : stredup(text);
MarkWholeScreenDirty();
CompanyAdminUpdate(c);
}
@@ -1163,7 +1163,7 @@ CommandCost CmdRenamePresident(TileIndex tile, DoCommandFlag flags, uint32 p1, u
if (reset) {
c->president_name = NULL;
} else {
- c->president_name = strdup(text);
+ c->president_name = stredup(text);
if (c->name_1 == STR_SV_UNNAMED && c->name == NULL) {
char buf[80];