summaryrefslogtreecommitdiff
path: root/src/story.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/story.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/story.cpp')
-rw-r--r--src/story.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/story.cpp b/src/story.cpp
index 46a193631..b74842f41 100644
--- a/src/story.cpp
+++ b/src/story.cpp
@@ -81,10 +81,10 @@ static void UpdateElement(StoryPageElement &pe, TileIndex tile, uint32 reference
{
switch (pe.type) {
case SPET_TEXT:
- pe.text = strdup(text);
+ pe.text = stredup(text);
break;
case SPET_LOCATION:
- pe.text = strdup(text);
+ pe.text = stredup(text);
pe.referenced_id = tile;
break;
case SPET_GOAL:
@@ -126,7 +126,7 @@ CommandCost CmdCreateStoryPage(TileIndex tile, DoCommandFlag flags, uint32 p1, u
if (StrEmpty(text)) {
s->title = NULL;
} else {
- s->title = strdup(text);
+ s->title = stredup(text);
}
InvalidateWindowClassesData(WC_STORY_BOOK, -1);
@@ -243,7 +243,7 @@ CommandCost CmdSetStoryPageTitle(TileIndex tile, DoCommandFlag flags, uint32 p1,
if (StrEmpty(text)) {
p->title = NULL;
} else {
- p->title = strdup(text);
+ p->title = stredup(text);
}
InvalidateWindowClassesData(WC_STORY_BOOK, page_id);