correct the return values

This commit is contained in:
Holger Vogt 2020-03-07 19:46:54 +01:00
parent ff07a21608
commit 02cf88c119
1 changed files with 12 additions and 6 deletions

View File

@ -755,8 +755,8 @@ gettok_node(char **s)
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* get_l_paren iterates the pointer forward in a string until it hits * get_l_paren iterates the pointer forward in a string until it hits
* the position after the next left paren "(". It returns 0 if it found a left * the position after the next left paren "(". It returns 0 if it found a left
* paren, and 1 if no left paren is found. It is called from 'translate' * paren, 1 if no left paren is found, -1 if left paren is the last character.
* (subckt.c). * It is called from 'translate' (subckt.c).
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
int int
@ -770,15 +770,18 @@ get_l_paren(char **s)
(*s)++; (*s)++;
return **s == '\0'; if (**s == '\0')
return -1;
return 0;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*
* get_r_paren iterates the pointer forward in a string until it hits * get_r_paren iterates the pointer forward in a string until it hits
* the position after the next right paren ")". It returns 0 if it found a right * the position after the next right paren ")". It returns 0 if it found a right
* paren, and 1 if no right paren is found. It is called from 'translate' * paren, 1 if no right paren is found, and -1 if right paren is te last
* (subckt.c). * character. It is called from 'translate' (subckt.c).
*-------------------------------------------------------------------------*/ *-------------------------------------------------------------------------*/
int int
@ -792,7 +795,10 @@ get_r_paren(char **s)
(*s)++; (*s)++;
return **s == '\0'; if (**s == '\0')
return -1;
return 0;
} }
/*-------------------------------------------------------------------------* /*-------------------------------------------------------------------------*