From: Bruno Haible Date: Sat, 28 Jan 2023 18:12:42 +0000 (+0100) Subject: vasnprintf-posix: Fix possible bug with negative width handling for %lc. X-Git-Tag: v1.0~1727 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=bf23b0fb3262feade1b22c60e6e60070f06cefcc;p=gnulib.git 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. --- 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"