From da698f8c1cd236d70554ab3eb68f860e2e7c3737 Mon Sep 17 00:00:00 2001
From: Stephan Schulz <stephan.schulz-x2q@rub.de>
Date: Tue, 9 Feb 2021 14:06:01 +0100
Subject: [PATCH] space pad error string for Fortran

---
 src/ALL_fortran.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ALL_fortran.cpp b/src/ALL_fortran.cpp
index 36f46c3..004cda9 100644
--- a/src/ALL_fortran.cpp
+++ b/src/ALL_fortran.cpp
@@ -302,6 +302,10 @@ void all_errdesc_c(char *description, size_t len) {
   } else {
     strncpy(description, "No error", len);
   }
+  // Use space padding instead of zero padding
+  // WARNING: The result is no longer a zero terminated string!
+  size_t msg_len = strlen(description);
+  memset(description+msg_len, ' ', len-msg_len);
 }
 }//extern "C"
 
-- 
GitLab