newlib: vf[w]scanf: Only return from a single point to simplify cleanup

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-11-30 11:36:04 +01:00
parent f636eae26f
commit 2e328edee4
2 changed files with 2 additions and 4 deletions

View File

@ -1623,8 +1623,7 @@ input_failure:
should have been set prior to here. On EOF failure (including should have been set prior to here. On EOF failure (including
invalid format string), return EOF if no matches yet, else number invalid format string), return EOF if no matches yet, else number
of matches made prior to failure. */ of matches made prior to failure. */
_newlib_flockfile_exit (fp); nassigned = nassigned && !(fp->_flags & __SERR) ? nassigned : EOF;
return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF;
match_failure: match_failure:
all_done: all_done:
/* Return number of matches, which can be 0 on match failure. */ /* Return number of matches, which can be 0 on match failure. */

View File

@ -1469,8 +1469,7 @@ input_failure:
should have been set prior to here. On EOF failure (including should have been set prior to here. On EOF failure (including
invalid format string), return EOF if no matches yet, else number invalid format string), return EOF if no matches yet, else number
of matches made prior to failure. */ of matches made prior to failure. */
_newlib_flockfile_exit (fp); nassigned = nassigned && !(fp->_flags & __SERR) ? nassigned : EOF;
return nassigned && !(fp->_flags & __SERR) ? nassigned : EOF;
match_failure: match_failure:
all_done: all_done:
/* Return number of matches, which can be 0 on match failure. */ /* Return number of matches, which can be 0 on match failure. */