[PATCH 01/15] stdio-common: Don't read real input beyond the field width in scanf [BZ #13988]

Andreas Schwab schwab@suse.de
Tue May 6 10:22:06 GMT 2025


On Apr 19 2025, Maciej W. Rozycki wrote:

> @@ -1657,7 +1657,8 @@ __vfscanf_internal (FILE *s, const char
>  			    break;
>  			  else
>  			    {
> -			      if (avail == 0 || inchar () == EOF)
> +			      if ((avail == 0 && (c = EOF))

Please avoid assignment in a conditional.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list