diff --git a/src/ALL_fortran.cpp b/src/ALL_fortran.cpp index 36f46c31d0e622db2dbfd88fba1883cf7879e3bc..004cda9edfd2efb234118882c33e4cb864059b75 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"