From 75bc477a0f45a8b5456924549b2a1368bb8a0399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Wed, 6 Jan 2010 11:28:18 +0000 Subject: [PATCH] - Fixed Print.printBuf scaling issues (it saved the length of the buffer, but did strlen(buf) regardless; major issues when reaching strings as short as 5MB). git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4737 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/runtime/printimpl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Compiler/runtime/printimpl.c b/Compiler/runtime/printimpl.c index 46989c442ba..e8cc2947ec0 100644 --- a/Compiler/runtime/printimpl.c +++ b/Compiler/runtime/printimpl.c @@ -149,9 +149,8 @@ RML_BEGIN_LABEL(Print__printBuf) } /* printf("increased -- cursize: %d, nfilled %d\n",cursize,nfilled);*/ } - sprintf((char*)(buf+strlen(buf)),"%s",str); - nfilled=strlen(buf); - /* printf("%s",str);*/ + nfilled += sprintf((char*)(buf+nfilled),"%s",str); + /*printf("%s",str);*/ RML_TAILCALLK(rmlSC); }