From: Christophe ThiƩry Date: Thu, 31 May 2012 15:59:38 +0000 (+0200) Subject: Lua: fix an indentation bug in debug logs (the stack crashed) X-Git-Tag: v3_8~654^2~12 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dda9405f7ee3f80c4b9c225117d08ec734f2a0f8 Lua: fix an indentation bug in debug logs (the stack crashed) --- diff --git a/src/bindings/lua/lua_state_cloner.c b/src/bindings/lua/lua_state_cloner.c index e33aebb3ba..11e97f2857 100644 --- a/src/bindings/lua/lua_state_cloner.c +++ b/src/bindings/lua/lua_state_cloner.c @@ -234,7 +234,6 @@ void sglua_copy_value(lua_State* src, lua_State* dst) { break; } - indent -= 2; XBT_DEBUG("%sData copied", sglua_get_spaces(indent)); sglua_stack_dump("src after copying a value (should be ... value): ", src); diff --git a/src/bindings/lua/lua_utils.c b/src/bindings/lua/lua_utils.c index 24bd4ab523..efd257a417 100644 --- a/src/bindings/lua/lua_utils.c +++ b/src/bindings/lua/lua_utils.c @@ -103,7 +103,8 @@ const char* sglua_get_spaces(int length) { static char spaces[128]; - xbt_assert(length < 128); + xbt_assert(length >= 0 && length < 128, + "Invalid indentation length: %d", length); if (length != 0) { memset(spaces, ' ', length); }