[PATCH] stdio-common: Consistently use 'num_digits_len' in 'vfscanf'

Maciej W. Rozycki macro@redhat.com
Thu May 22 17:17:20 GMT 2025


Make the only place use 'num_digits_len' where 10 is referred literally 
for a digit index in i18n handling for decimal integers.  No change in 
code produced.
---
Verified with a `powerpc64le-linux-gnu' native configuration.
---
 stdio-common/vfscanf-internal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

glibc-scanf-num-digits-len.diff
Index: glibc/stdio-common/vfscanf-internal.c
===================================================================
--- glibc.orig/stdio-common/vfscanf-internal.c
+++ glibc/stdio-common/vfscanf-internal.c
@@ -1737,7 +1737,7 @@ __vfscanf_internal (FILE *s, const char
 #endif
 			    }
 
-			  if (n < 10)
+			  if (n < num_digits_len)
 			    {
 			      /* Found it.  */
 			      from_level = level;



More information about the Libc-alpha mailing list