may not call memmove() on a null pointer, even if 'n' is 0.

This commit is contained in:
Axel Kohlmeyer
2021-08-02 21:35:25 -04:00
parent 04c7e7543e
commit c1c31c6b04

View File

@ -5122,7 +5122,7 @@ int VarReader::read_scalar(char *str)
if (n == 1) continue; // skip if blank line if (n == 1) continue; // skip if blank line
break; break;
} }
memmove(str,ptr,n); // move trimmed string back if (n > 0) memmove(str,ptr,n); // move trimmed string back
} }
MPI_Bcast(&n,1,MPI_INT,0,world); MPI_Bcast(&n,1,MPI_INT,0,world);
if (n == 0) return 1; if (n == 0) return 1;