fix uninitialized variable access through local variable scoping

This commit is contained in:
Axel Kohlmeyer
2022-12-19 19:59:54 -05:00
parent 457746dadc
commit 078468a94f
2 changed files with 4 additions and 4 deletions

View File

@ -1515,8 +1515,8 @@ void Grid2d::read_file_style(T *ptr, FILE *fp, int nchunk, int maxline)
bigint nread = 0; bigint nread = 0;
while (nread < ntotal) { while (nread < ntotal) {
int nchunk = MIN(ntotal - nread, nchunk); int mychunk = MIN(ntotal - nread, nchunk);
int eof = utils::read_lines_from_file(fp, nchunk, maxline, buffer, me, world); int eof = utils::read_lines_from_file(fp, mychunk, maxline, buffer, me, world);
if (eof) error->all(FLERR, "Unexpected end of grid data file"); if (eof) error->all(FLERR, "Unexpected end of grid data file");
nread += ptr->unpack_read_grid(nchunk,buffer); nread += ptr->unpack_read_grid(nchunk,buffer);

View File

@ -1686,8 +1686,8 @@ void Grid3d::read_file_style(T *ptr, FILE *fp, int nchunk, int maxline)
bigint nread = 0; bigint nread = 0;
while (nread < ntotal) { while (nread < ntotal) {
int nchunk = MIN(ntotal - nread, nchunk); int mychunk = MIN(ntotal - nread, nchunk);
int eof = utils::read_lines_from_file(fp, nchunk, maxline, buffer, me, world); int eof = utils::read_lines_from_file(fp, mychunk, maxline, buffer, me, world);
if (eof) error->all(FLERR, "Unexpected end of grid data file"); if (eof) error->all(FLERR, "Unexpected end of grid data file");
nread += ptr->unpack_read_grid(nchunk,buffer); nread += ptr->unpack_read_grid(nchunk,buffer);