From 634e0234852ebb37d6cb10bc627d84ebaf35d56f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 4 Jun 2009 08:25:48 +0000 Subject: Turned debug_weak_validations on by default again, as apparently some games like SQ3 fail in some validations (e.g. when loading). Also, fixed a potential out of bounds access when copying the value of __FILE__ into a buffer (as its value can be quite long in some cases). svn-id: r41154 --- engines/sci/console.cpp | 2 +- engines/sci/engine/vm.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 67e324f078..baf89a5082 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -50,7 +50,7 @@ extern EngineState *g_EngineState; int debug_sleeptime_factor = 1; int debug_simulated_key = 0; bool debug_track_mouse_clicks = false; -bool debug_weak_validations = false; +bool debug_weak_validations = true; Console::Console(SciEngine *vm) : GUI::Debugger() { diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 18e1ef7866..3539032760 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -121,15 +121,13 @@ static int validate_variable(reg_t *r, reg_t *stack_base, int type, int max, int if (index < 0 || index >= max) { char txt[200]; char tmp[40]; - sprintf(txt, "[VM] Attempt to use invalid %s variable %04x ", names[type], index); + sprintf(txt, "[VM] validate_variable(): Attempt to use invalid %s variable %04x ", names[type], index); if (max == 0) strcat(txt, "(variable type invalid)"); else { sprintf(tmp, "(out of range [%d..%d])", 0, max - 1); strcat(txt, tmp); } - sprintf(tmp, " in %s, line %d\n", __FILE__, line); - strcat(txt, tmp); if (debug_weak_validations) warning(txt); -- cgit v1.2.3