NULL-terminate buffer when reading PP file.

This commit is contained in:
Mark Dewing 2017-06-05 16:02:41 -05:00
parent f74f9531ac
commit 4b76afad97
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ bool ReadFileBuffer::read_contents()
}
if (myComm) myComm->bcast(length);
cbuffer = new char[length];
cbuffer = new char[length+1];
cbuffer[length] = '\0';
if (myComm == NULL || myComm->rank() == 0)
fin->read (cbuffer,length);