From 75c46b7a277a7c6e3fe559f88db1f7c7ff5885b9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 30 Dec 2009 20:31:43 +0000 Subject: (svn r18671) -Fix [FS#3452]: [NewGRF] If an action B did not have a 'data' string but would print it OpenTTD would segfault --- src/newgrf.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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. */ -- cgit v1.2.3-70-g09d2