Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Co-Authored-By: Lew Rossman <[email protected]>
  • Loading branch information
Mariosmsk and LRossman committed Aug 1, 2024
1 parent b16dacb commit 3604f3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/epanet.c
Original file line number Diff line number Diff line change
Expand Up @@ -4526,6 +4526,7 @@ int DLLEXPORT EN_loadpatternfile(EN_Project p, const char *filename, const char
{
FILE *file;
char line[MAXLINE+1];
char *tok;
int err = 0;
int i;
int len = 0;
Expand All @@ -4552,7 +4553,9 @@ int DLLEXPORT EN_loadpatternfile(EN_Project p, const char *filename, const char
while (fgets(line, sizeof(line), file) != NULL) {

// Skip lines that don't contain valid numbers
if (!getfloat(line, &value)) continue;
tok = strtok(line, SEPSTR);
if (tok == NULL) continue;
if (!getfloat(tok, &value)) continue;

// Resize multiplier array if it's full
if (len % CHUNK == 0) {
Expand Down

0 comments on commit 3604f3f

Please sign in to comment.