(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)

This commit is contained in:
rubidium
2014-04-25 15:40:32 +00:00
parent 0b159549d4
commit 034735a54c
70 changed files with 207 additions and 183 deletions

View File

@@ -55,7 +55,7 @@ CommandCost CmdPlaceSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
si->y = y;
si->z = GetSlopePixelZ(x, y);
if (!StrEmpty(text)) {
si->name = strdup(text);
si->name = stredup(text);
}
si->UpdateVirtCoord();
InvalidateWindowData(WC_SIGN_LIST, 0, 0);
@@ -90,7 +90,7 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Delete the old name */
free(si->name);
/* Assign the new one */
si->name = strdup(text);
si->name = stredup(text);
if (_game_mode != GM_EDITOR) si->owner = _current_company;
si->UpdateVirtCoord();