From bf23b0fb3262feade1b22c60e6e60070f06cefcc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 28 Jan 2023 19:12:42 +0100 Subject: [PATCH] vasnprintf-posix: Fix possible bug with negative width handling for %lc. * lib/vasnprintf.c (VASNPRINTF): In the code for %lc in vasnprintf, test for the FLAG_LEFT bit in the flags variable. * tests/test-vasnprintf-posix.c (test_function): Add tests for width given as argument for the directives %c, %lc. * tests/test-vasprintf-posix.c (test_function): Likewise. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-snprintf-posix.c: Include , for wint_t. * tests/test-sprintf-posix.c: Likewise. * tests/test-vsnprintf-posix.c: Likewise. * tests/test-vsprintf-posix.c: Likewise. --- ChangeLog | 2 ++ tests/test-vsnprintf-posix.c | 1 + tests/test-vsprintf-posix.c | 1 + 3 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index e7cfe12ad4..c5617e886c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-snprintf-posix.c: Include , for wint_t. * tests/test-sprintf-posix.c: Likewise. + * tests/test-vsnprintf-posix.c: Likewise. + * tests/test-vsprintf-posix.c: Likewise. 2023-01-28 Bruno Haible diff --git a/tests/test-vsnprintf-posix.c b/tests/test-vsnprintf-posix.c index 5448f6769a..6f14446eab 100644 --- a/tests/test-vsnprintf-posix.c +++ b/tests/test-vsnprintf-posix.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "macros.h" diff --git a/tests/test-vsprintf-posix.c b/tests/test-vsprintf-posix.c index fa8b092c7a..103f8b681a 100644 --- a/tests/test-vsprintf-posix.c +++ b/tests/test-vsprintf-posix.c @@ -29,6 +29,7 @@ SIGNATURE_CHECK (vsprintf, int, (char *, char const *, va_list)); #include #include #include +#include #include "macros.h" -- 2.39.5