summaryrefslogtreecommitdiffstats
path: root/src/map/mio/mioParse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mio/mioParse.c')
-rw-r--r--src/map/mio/mioParse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/map/mio/mioParse.c b/src/map/mio/mioParse.c
index cac21596..6d7740a2 100644
--- a/src/map/mio/mioParse.c
+++ b/src/map/mio/mioParse.c
@@ -429,7 +429,7 @@ void Mio_ParseFormulaTruthTest( char * pFormInit, char ** ppVarNames, int nVars
int Mio_ParseCheckName( Mio_Gate_t * pGate, char ** ppStr )
{
Mio_Pin_t * pPin;
- int i, iBest;
+ int i, iBest = -1;
// find the longest pin name that matches substring
char * pNameBest = NULL;
for ( pPin = Mio_GateReadPins(pGate), i = 0; pPin; pPin = Mio_PinReadNext(pPin), i++ )
@@ -437,9 +437,8 @@ int Mio_ParseCheckName( Mio_Gate_t * pGate, char ** ppStr )
if ( pNameBest == NULL || strlen(pNameBest) < strlen(Mio_PinReadName(pPin)) )
pNameBest = Mio_PinReadName(pPin), iBest = i;
// if pin is not found, return -1
- if ( pNameBest == NULL )
- return -1;
- *ppStr += strlen(pNameBest) - 1;
+ if ( pNameBest )
+ *ppStr += strlen(pNameBest) - 1;
return iBest;
}
int Mio_ParseCheckFormula( Mio_Gate_t * pGate, char * pForm )