From 2c67a6d5a73c084b01457d8bb4d40a14fb04053a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 29 Aug 2002 06:13:34 +0000 Subject: [PATCH] Add sanity check to catch the error I just corrected. --- stepmania/src/Disasm.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Disasm.cpp b/stepmania/src/Disasm.cpp index 329bac8947..97e1cba64c 100644 --- a/stepmania/src/Disasm.cpp +++ b/stepmania/src/Disasm.cpp @@ -17,7 +17,6 @@ #include #include -#include #include @@ -289,6 +288,13 @@ static void VDDisasmExpandRule(VDDisassemblyContext *pContext, char *s, const un s += sprintf(s, "%08lx", symoffset); break; case kTarget_s: + if(arg_s < (const char *) 0x100) { + /* Oops--somehow we got a character value on the stack where + * we expected a string. This is probably an error in the + * disassembly rules. */ + s = strtack(s, "(DISASSEMBLY ERROR: STRING EXPECTED)"); + break; + } s = strtack(s, arg_s); break; }