From f969d9ab720bc4d29e4807cf7567d976b2cbdc0e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 10 Jul 2020 09:22:44 -0400 Subject: [PATCH] add space for terminating NULL byte in MPIIO dump styles. closes #2225 --- src/MPIIO/dump_atom_mpiio.cpp | 4 ++-- src/MPIIO/dump_cfg_mpiio.cpp | 2 +- src/MPIIO/dump_custom_mpiio.cpp | 2 +- src/MPIIO/dump_xyz_mpiio.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index d59ed7bde8..9d15e8b1a8 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -618,7 +618,7 @@ int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount; + maxsbuf = mpifhStringCount+1; memory->grow(sbuf,maxsbuf,"dump:sbuf"); } sbuf[0] = '\0'; @@ -708,7 +708,7 @@ int DumpAtomMPIIO::convert_noimage_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount; + maxsbuf = mpifhStringCount+1; memory->grow(sbuf,maxsbuf,"dump:sbuf"); } sbuf[0] = '\0'; diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 18368db330..bca19e58c8 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -452,7 +452,7 @@ int DumpCFGMPIIO::convert_string_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount; + maxsbuf = mpifhStringCount+1; memory->grow(sbuf,maxsbuf,"dump:sbuf"); } sbuf[0] = '\0'; diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 526021d895..3f9c09738e 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -652,7 +652,7 @@ int DumpCustomMPIIO::convert_string_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount; + maxsbuf = mpifhStringCount+1; memory->grow(sbuf,maxsbuf,"dump:sbuf"); } sbuf[0] = '\0'; diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index a1e4f21a79..d1b2d5079a 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -382,7 +382,7 @@ int DumpXYZMPIIO::convert_string_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount; + maxsbuf = mpifhStringCount+1; memory->grow(sbuf,maxsbuf,"dump:sbuf"); } sbuf[0] = '\0';