From d8d4e03ef0522097adb78ee606e5f9cc489c0d29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christophe=20Thi=C3=A9ry?= Date: Fri, 28 Oct 2011 12:11:00 +0200 Subject: [PATCH 1/1] Don't memset to zero --- src/bindings/lua/lua_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bindings/lua/lua_utils.c b/src/bindings/lua/lua_utils.c index 84b8ca2799..3f1f523f0a 100644 --- a/src/bindings/lua/lua_utils.c +++ b/src/bindings/lua/lua_utils.c @@ -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; } -- 2.20.1