summaryrefslogtreecommitdiff
path: root/src/strgen/strgen.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/strgen/strgen.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/strgen/strgen.cpp')
-rw-r--r--src/strgen/strgen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 4cd2454f4..7769ca242 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -247,7 +247,7 @@ struct FileWriter {
*/
FileWriter(const char *filename)
{
- this->filename = strdup(filename);
+ this->filename = stredup(filename);
this->fh = fopen(this->filename, "wb");
if (this->fh == NULL) {
@@ -285,7 +285,7 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
* @param filename The file to open.
*/
HeaderFileWriter(const char *filename) : FileWriter("tmp.xxx"),
- real_filename(strdup(filename)), prev(0)
+ real_filename(stredup(filename)), prev(0)
{
fprintf(this->fh, "/* This file is automatically generated. Do not modify */\n\n");
fprintf(this->fh, "#ifndef TABLE_STRINGS_H\n");