summaryrefslogtreecommitdiff
path: root/src/error_gui.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/error_gui.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/error_gui.cpp')
-rw-r--r--src/error_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index 34a49c74d..98988de5a 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -77,7 +77,7 @@ ErrorMessageData::ErrorMessageData(const ErrorMessageData &data)
*this = data;
for (size_t i = 0; i < lengthof(this->strings); i++) {
if (this->strings[i] != NULL) {
- this->strings[i] = strdup(this->strings[i]);
+ this->strings[i] = stredup(this->strings[i]);
this->decode_params[i] = (size_t)this->strings[i];
}
}
@@ -158,7 +158,7 @@ void ErrorMessageData::SetDParam(uint n, uint64 v)
void ErrorMessageData::SetDParamStr(uint n, const char *str)
{
free(this->strings[n]);
- this->strings[n] = strdup(str);
+ this->strings[n] = stredup(str);
}
/** Define a queue with errors. */