forked from mirror/OpenTTD
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user