Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't memset to zero
[simgrid.git] / src / bindings / lua / lua_utils.c
index 84b8ca2..3f1f523 100644 (file)
@@ -103,7 +103,9 @@ const char* sglua_get_spaces(int length) {
   static char spaces[128];
 
   xbt_assert(length < 128);
-  memset(spaces, ' ', length);
+  if (length != 0) {
+    memset(spaces, ' ', length);
+  }
   spaces[length] = '\0';
   return spaces;
 }