Fixes problem with findpattern() function (issue #498)

This commit is contained in:
Lew Rossman
2019-05-24 10:33:36 -04:00
parent e4e6d49f52
commit 40c39fd3c6
2 changed files with 14 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 05/15/2019
Last Updated: 05/24/2019
******************************************************************************
*/
@@ -815,17 +815,19 @@ int findpattern(Network *network, char *id)
/*----------------------------------------------------------------
** Input: id = time pattern ID
** Output: none
** Returns: time pattern index, or 0 if pattern not found
** Returns: time pattern index, or -1 if pattern not found
** Purpose: finds index of time pattern given its ID
**----------------------------------------------------------------
*/
{
int i;
for (i = 1; i <= network->Npats; i++)
// Don't forget to include the "dummy" pattern 0 in the search
for (i = 0; i <= network->Npats; i++)
{
if (strcmp(id, network->Pattern[i].ID) == 0) return i;
}
return 0;
return -1;
}
int findcurve(Network *network, char *id)