summaryrefslogtreecommitdiff
path: root/src/base_consist.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/base_consist.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/base_consist.cpp')
-rw-r--r--src/base_consist.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/base_consist.cpp b/src/base_consist.cpp
index 805e1d58f..c7fcdec21 100644
--- a/src/base_consist.cpp
+++ b/src/base_consist.cpp
@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "base_consist.h"
#include "vehicle_base.h"
+#include "string_func.h"
#include "safeguards.h"
@@ -29,7 +30,7 @@ void BaseConsist::CopyConsistPropertiesFrom(const BaseConsist *src)
if (this == src) return;
free(this->name);
- this->name = src->name != NULL ? strdup(src->name) : NULL;
+ this->name = src->name != NULL ? stredup(src->name) : NULL;
this->current_order_time = src->current_order_time;
this->lateness_counter = src->lateness_counter;