diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-05-17 23:31:59 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-05-21 20:02:34 +0200 |
commit | 63ccb36ef3ecd53a503c0e9fea87f0784802af0f (patch) | |
tree | d3e1134029fd437d1ad2d948f83592b930e9456f /src/signs_cmd.cpp | |
parent | 9b6f5e3bb850b6cff02cc761767fcdf49c681645 (diff) | |
download | openttd-63ccb36ef3ecd53a503c0e9fea87f0784802af0f.tar.xz |
Codechange: Use std::string for most of the user-settable custom names.
Diffstat (limited to 'src/signs_cmd.cpp')
-rw-r--r-- | src/signs_cmd.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index d2caa4a23..a0843917d 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -86,10 +86,8 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (Utf8StringLength(text) >= MAX_LENGTH_SIGN_NAME_CHARS) return CMD_ERROR; if (flags & DC_EXEC) { - /* Delete the old name */ - free(si->name); /* Assign the new one */ - si->name = stredup(text); + si->name = text; if (_game_mode != GM_EDITOR) si->owner = _current_company; si->UpdateVirtCoord(); |