Fix off-by-one mistake, Fixes #2300

This commit is contained in:
Richard Berger 2020-08-22 12:03:24 -04:00
parent 2a6546d6f0
commit f82b19e21f
No known key found for this signature in database
GPG Key ID: A9E83994E0BA0CAB
1 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ int main(int narg, char **arg)
delete [] unit_style;
unit_style = new char[len+1];
fread(unit_style, sizeof(char), len, fp);
unit_style[len+1] = '\0';
unit_style[len] = '\0';
fprintf(fptxt, "ITEM: UNITS\n");
fprintf(fptxt, "%s\n", unit_style);
}
@ -176,7 +176,7 @@ int main(int narg, char **arg)
delete [] columns;
columns = new char[len+1];
fread(columns, sizeof(char), len, fp);
columns[len+1] = '\0';
columns[len] = '\0';
}
fread(&nchunk,sizeof(int),1,fp);