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 24bd4ab..efd257a 100644 (file)
@@ -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);
   }