summaryrefslogtreecommitdiff
path: root/src/deh_text.c
diff options
context:
space:
mode:
authorSimon Howard2005-10-08 20:54:16 +0000
committerSimon Howard2005-10-08 20:54:16 +0000
commit5547ba06ca0e267fa82a6b9b7953a980e0876e61 (patch)
treec4a27e16fde56addc8e00e4d3f0badddaf3449f8 /src/deh_text.c
parent25f6da1861deedeb2d0650ecf0ebe42a83b682c8 (diff)
downloadchocolate-doom-5547ba06ca0e267fa82a6b9b7953a980e0876e61.tar.gz
chocolate-doom-5547ba06ca0e267fa82a6b9b7953a980e0876e61.tar.bz2
chocolate-doom-5547ba06ca0e267fa82a6b9b7953a980e0876e61.zip
Proper dehacked error/warning framework. Catch a load more errors.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 175
Diffstat (limited to 'src/deh_text.c')
-rw-r--r--src/deh_text.c11
1 files changed, 9 insertions, 2 deletions
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);