Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lua: fix an indentation bug in debug logs (the stack crashed)
[simgrid.git] / src / bindings / lua / lua_utils.c
index 24bd4ab52369085528c1670593d0dafd848e3346..efd257a417550a8e392900e9c3c0644aab3b801c 100644 (file)
@@ -103,7 +103,8 @@ const char* sglua_get_spaces(int length) {
 
   static char spaces[128];
 
 
   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);
   }
   if (length != 0) {
     memset(spaces, ' ', length);
   }