summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-12-30 20:31:43 +0000
committerrubidium <rubidium@openttd.org>2009-12-30 20:31:43 +0000
commit75c46b7a277a7c6e3fe559f88db1f7c7ff5885b9 (patch)
treec3700c57fdd62b5ac2caead55bb35bd785aa4fcf
parentd86dbabbc44a637f31c065771400d1ed4a3c6f5c (diff)
downloadopenttd-75c46b7a277a7c6e3fe559f88db1f7c7ff5885b9.tar.xz
(svn r18671) -Fix [FS#3452]: [NewGRF] If an action B did not have a 'data' string but would print it OpenTTD would segfault
-rw-r--r--src/newgrf.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index f30b2ef97..7d21ba60b 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -4371,6 +4371,9 @@ static void GRFLoadError(byte *buf, size_t len)
len -= (strlen(data) + 1);
error->data = TranslateTTDPatchCodes(_cur_grffile->grfid, data);
+ } else {
+ grfmsg(7, "GRFLoadError: No message data supplied.");
+ error->data = strdup("");
}
/* Only two parameter numbers can be used in the string. */