add space for terminating NULL byte in MPIIO dump styles.

closes #2225
This commit is contained in:
Axel Kohlmeyer
2020-07-10 09:22:44 -04:00
parent f307d7f5f9
commit f969d9ab72
4 changed files with 5 additions and 5 deletions

View File

@ -618,7 +618,7 @@ int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf)
if (mpifhStringCount > 0) { if (mpifhStringCount > 0) {
if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > maxsbuf) {
if (mpifhStringCount > MAXSMALLINT) return -1; if (mpifhStringCount > MAXSMALLINT) return -1;
maxsbuf = mpifhStringCount; maxsbuf = mpifhStringCount+1;
memory->grow(sbuf,maxsbuf,"dump:sbuf"); memory->grow(sbuf,maxsbuf,"dump:sbuf");
} }
sbuf[0] = '\0'; sbuf[0] = '\0';
@ -708,7 +708,7 @@ int DumpAtomMPIIO::convert_noimage_omp(int n, double *mybuf)
if (mpifhStringCount > 0) { if (mpifhStringCount > 0) {
if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > maxsbuf) {
if (mpifhStringCount > MAXSMALLINT) return -1; if (mpifhStringCount > MAXSMALLINT) return -1;
maxsbuf = mpifhStringCount; maxsbuf = mpifhStringCount+1;
memory->grow(sbuf,maxsbuf,"dump:sbuf"); memory->grow(sbuf,maxsbuf,"dump:sbuf");
} }
sbuf[0] = '\0'; sbuf[0] = '\0';

View File

@ -452,7 +452,7 @@ int DumpCFGMPIIO::convert_string_omp(int n, double *mybuf)
if (mpifhStringCount > 0) { if (mpifhStringCount > 0) {
if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > maxsbuf) {
if (mpifhStringCount > MAXSMALLINT) return -1; if (mpifhStringCount > MAXSMALLINT) return -1;
maxsbuf = mpifhStringCount; maxsbuf = mpifhStringCount+1;
memory->grow(sbuf,maxsbuf,"dump:sbuf"); memory->grow(sbuf,maxsbuf,"dump:sbuf");
} }
sbuf[0] = '\0'; sbuf[0] = '\0';

View File

@ -652,7 +652,7 @@ int DumpCustomMPIIO::convert_string_omp(int n, double *mybuf)
if (mpifhStringCount > 0) { if (mpifhStringCount > 0) {
if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > maxsbuf) {
if (mpifhStringCount > MAXSMALLINT) return -1; if (mpifhStringCount > MAXSMALLINT) return -1;
maxsbuf = mpifhStringCount; maxsbuf = mpifhStringCount+1;
memory->grow(sbuf,maxsbuf,"dump:sbuf"); memory->grow(sbuf,maxsbuf,"dump:sbuf");
} }
sbuf[0] = '\0'; sbuf[0] = '\0';

View File

@ -382,7 +382,7 @@ int DumpXYZMPIIO::convert_string_omp(int n, double *mybuf)
if (mpifhStringCount > 0) { if (mpifhStringCount > 0) {
if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > maxsbuf) {
if (mpifhStringCount > MAXSMALLINT) return -1; if (mpifhStringCount > MAXSMALLINT) return -1;
maxsbuf = mpifhStringCount; maxsbuf = mpifhStringCount+1;
memory->grow(sbuf,maxsbuf,"dump:sbuf"); memory->grow(sbuf,maxsbuf,"dump:sbuf");
} }
sbuf[0] = '\0'; sbuf[0] = '\0';