From 5547ba06ca0e267fa82a6b9b7953a980e0876e61 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 8 Oct 2005 20:54:16 +0000 Subject: Proper dehacked error/warning framework. Catch a load more errors. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 175 --- src/deh_text.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/deh_text.c') diff --git a/src/deh_text.c b/src/deh_text.c index e2c86662..6d95944b 100644 --- a/src/deh_text.c +++ b/src/deh_text.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: deh_text.c 160 2005-10-03 21:39:39Z fraggle $ +// $Id: deh_text.c 175 2005-10-08 20:54:16Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.4 2005/10/08 20:54:16 fraggle +// Proper dehacked error/warning framework. Catch a load more errors. +// // Revision 1.3 2005/10/03 21:39:39 fraggle // Dehacked text substitutions // @@ -174,7 +177,11 @@ static void *DEH_TextStart(deh_context_t *context, char *line) int fromlen, tolen; int i; - sscanf(line, "Text %i %i", &fromlen, &tolen); + if (sscanf(line, "Text %i %i", &fromlen, &tolen) != 2) + { + DEH_Warning(context, "Parse error on section start"); + return NULL; + } sub = Z_Malloc(sizeof(deh_substitution_t), PU_STATIC, NULL); sub->from_text = Z_Malloc(fromlen + 1, PU_STATIC, NULL); -- cgit v1.2.3