]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf: Re-enable parsing of directive with I64 (regr. 2023-03-24).
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 11 Nov 2023 21:53:33 +0000 (22:53 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 24 Nov 2023 07:11:30 +0000 (08:11 +0100)
In 480a59ba60 (*printf-posix: ISO C 23: Support size specifiers 'wN' and
'wfN'., 2023-03-24), a major refactoring hides a bug in the conversion
of the code handling Windows' "%I64*" family of printf() formats:
before the refactoring, the "64" part was skipped (as desired), but
afterwards that part is not skipped and therefore the '6' is mistaken
for a conversion character. Which is invalid, of course, causing the
code to error out.

Fix this by skipping the "64" part again.

This bug was uncovered by the Git for Windows project when gettext
v0.22.3 switched to the gnulib code as work horse of the
libintl_vsnprintf() function.

* lib/printf-parse.c (PRINTF_PARSE): When parsing a size specifier
"I64", increment cp by 3, not 1.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copyright-paperwork-exempt: Yes

ChangeLog
lib/printf-parse.c

index ec97c989b85bae45f5f4992f64f514dba06d4e85..31f49bef6994dd80faf7f1c2b2291f689acb4911 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-11-11  Johannes Schindelin  <johannes.schindelin@gmx.de>
+
+       vasnprintf: Re-enable parsing of directive with I64 (regr. 2023-03-24).
+       * lib/printf-parse.c (PRINTF_PARSE): When parsing a size specifier
+       "I64", increment cp by 3, not 1.
+
 2023-11-10  Bruno Haible  <bruno@clisp.org>
 
        tests: In multithreaded tests, use random() instead of rand().
index d3f2c3cb5d1b634a0d43d21eca222969ef5efc2b..6741ee5ff4e3b55e1d242087c2a968b3ed71f060 100644 (file)
@@ -555,7 +555,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                     unsigned_type = TYPE_ULONGINT;
                     pointer_type = TYPE_COUNT_LONGINT_POINTER;
                   }
-                cp++;
+                cp += 3;
               }
 #endif