diff options
-rw-r--r-- | src/util/ieee_recombiner.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/ieee_recombiner.c b/src/util/ieee_recombiner.c index 4b44ba9..76b7823 100644 --- a/src/util/ieee_recombiner.c +++ b/src/util/ieee_recombiner.c @@ -718,7 +718,9 @@ void copyAttributes (IOFile infile, IOFile outfile, int nprocs, #endif /* copy from Long to int */ tmp_int = num_elems; - buffer = malloc (IOnBytes (datatype, 1, &tmp_int)); + + /* add one more byte for trailing '\0' characters in string attributes */ + buffer = malloc (1 + IOnBytes (datatype, 1, &tmp_int)); IOreadAttribute (infile, attr, buffer); /* reset 'GH$nprocs', 'GH$ioproc_every', and 'unchunked' attributes |