From e1689be8aed5e8ed5fd506c0bfee6d04e1c49194 Mon Sep 17 00:00:00 2001 From: Henning Kiel Date: Mon, 13 Feb 2012 06:54:00 +0000 Subject: [PATCH] fix array access out of bounds static variable buf does not allow reentrance here (would be better put on stack = not static) git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11091 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/runtime/System_omc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Compiler/runtime/System_omc.cpp b/Compiler/runtime/System_omc.cpp index e7fa920cc14..d49a42799c5 100644 --- a/Compiler/runtime/System_omc.cpp +++ b/Compiler/runtime/System_omc.cpp @@ -680,7 +680,7 @@ extern const char* System_snprintff(const char *fmt, int len, double d) static char buf[1024]; assert(1024>len); snprintf(buf,len,fmt,d); - buf[1024] = 0; + buf[1023] = 0; } }