From 9ed12b0f07edb342aaff21c130d325fd158a9d5b Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 25 Apr 2014 15:40:32 +0000 Subject: (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) --- src/story.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/story.cpp') 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); -- cgit v1.2.3-54-g00ecf