diff --git a/opal/util/output.c b/opal/util/output.c index 73bdfce4d3..dc1a51af52 100644 --- a/opal/util/output.c +++ b/opal/util/output.c @@ -172,6 +172,7 @@ bool opal_output_init(void) verbose.lds_want_stderr = true; } gethostname(hostname, sizeof(hostname)); + hostname[sizeof(hostname)-1] = '\0'; asprintf(&verbose.lds_prefix, "[%s:%05d] ", hostname, getpid()); for (i = 0; i < OPAL_OUTPUT_MAX_STREAMS; ++i) {