From db1fa494f8efb6fc28862993825f546f40efcfde Mon Sep 17 00:00:00 2001
From: ralfulrich <ralf.ulrich@kit.edu>
Date: Fri, 2 Oct 2020 19:38:54 +0200
Subject: [PATCH] also fill rest of string

---
 readLib/source/Interface.boost.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/readLib/source/Interface.boost.cc b/readLib/source/Interface.boost.cc
index 31ef327..f2fb278 100644
--- a/readLib/source/Interface.boost.cc
+++ b/readLib/source/Interface.boost.cc
@@ -88,7 +88,9 @@ namespace corsika_data {
   void CorDataNextText(char* data, const int maxlength) {
     std::string STR;
     CorDataNextText(STR);
-    for (int i = 0; i < maxlength && i < (int)STR.size(); ++i) data[i] = STR[i];
+    int i = 0;
+    for (; i < maxlength && i < (int)STR.size(); ++i) data[i] = STR[i];
+    for (; i < maxlength; ++i) data[i] = 0;
   }
   bool CorDataCanDeCompress() { return true; }
 
-- 
GitLab