Bug fixes

This commit is contained in:
Lew Rossman
2019-04-02 22:21:05 -04:00
parent 77851dcc5b
commit 6a4b95f4d5
3 changed files with 23 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ Description: reads and interprets network data from an EPANET input file
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 03/17/2019
Last Updated: 04/02/2019
******************************************************************************
*/
@@ -860,6 +860,12 @@ int gettokens(char *s, char** Tok, int maxToks, char *comment)
while (len > 0 && n < MAXTOKS)
{
m = (int)strcspn(s,SEPSTR); // Find token length
if (m == len) // s is last token
{
Tok[n] = s;
n++;
break;
}
len -= m+1; // Update length of s
if (m == 0) s++; // No token found
else