summaryrefslogtreecommitdiff
path: root/src/game
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/game
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/game')
-rw-r--r--src/game/game_text.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp
index 30e630495..f717e2dc0 100644
--- a/src/game/game_text.cpp
+++ b/src/game/game_text.cpp
@@ -212,7 +212,7 @@ struct StringNameWriter : HeaderWriter {
void WriteStringID(const char *name, int stringid)
{
- if (stringid == (int)this->strings->Length()) *this->strings->Append() = strdup(name);
+ if (stringid == (int)this->strings->Length()) *this->strings->Append() = stredup(name);
}
void Finalise(const StringData &data)
@@ -231,7 +231,7 @@ private:
public:
/** Initialise */
- LanguageScanner(GameStrings *gs, const char *exclude) : gs(gs), exclude(strdup(exclude)) {}
+ LanguageScanner(GameStrings *gs, const char *exclude) : gs(gs), exclude(stredup(exclude)) {}
~LanguageScanner() { free(exclude); }
/**