summaryrefslogtreecommitdiff
path: root/src/signs.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-31 20:50:59 +0000
committerrubidium <rubidium@openttd.org>2007-08-31 20:50:59 +0000
commit10475e88c620a245794244d27189af53bdd1fa35 (patch)
tree0e5e9096dc7035d2f09b1baf313359d3629e2eac /src/signs.cpp
parentc720d9d83aab9bc5a640b9a12b63104512120374 (diff)
downloadopenttd-10475e88c620a245794244d27189af53bdd1fa35.tar.xz
(svn r11026) -Fix: the name of a sign could sometimes be NULL causing crashes.
Diffstat (limited to 'src/signs.cpp')
-rw-r--r--src/signs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/signs.cpp b/src/signs.cpp
index f8ad95f45..0004a65d8 100644
--- a/src/signs.cpp
+++ b/src/signs.cpp
@@ -13,6 +13,7 @@
#include "saveload.h"
#include "command.h"
#include "variables.h"
+#include "string.h"
#include "misc/autoptr.hpp"
SignID _new_sign_id;
@@ -128,7 +129,7 @@ CommandCost CmdRenameSign(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* If _cmd_text 0 means the new text for the sign is non-empty.
* So rename the sign. If it is empty, it has no name, so delete it */
- if (_cmd_text[0] != '\0') {
+ if (!StrEmpty(_cmd_text)) {
/* Create the name */
StringID str = AllocateName(_cmd_text, 0);
if (str == 0) return CMD_ERROR;