]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf-posix: Fix possible bug with negative width handling for %lc.
authorBruno Haible <bruno@clisp.org>
Sat, 28 Jan 2023 18:12:42 +0000 (19:12 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 28 Jan 2023 18:12:42 +0000 (19:12 +0100)
* 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 <wchar.h>, for wint_t.
* tests/test-sprintf-posix.c: Likewise.
* tests/test-vsnprintf-posix.c: Likewise.
* tests/test-vsprintf-posix.c: Likewise.

ChangeLog
tests/test-vsnprintf-posix.c
tests/test-vsprintf-posix.c

index e7cfe12ad4f161d76e51752c455efc7ac0604e44..c5617e886c4cfe0a0220034a706b6ec798d3a5c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@
        * tests/test-sprintf-posix.h (test_function): Likewise.
        * tests/test-snprintf-posix.c: Include <wchar.h>, 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  <bruno@clisp.org>
 
index 5448f6769ade62c1706568a6623b00b13322527b..6f14446eab8b3e43555046b09dd22192037b9001 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wchar.h>
 
 #include "macros.h"
 
index fa8b092c7a619bc14b5b5ffed6507da49cfde033..103f8b681a92ed1491f82bfe051f16e88274aa8b 100644 (file)
@@ -29,6 +29,7 @@ SIGNATURE_CHECK (vsprintf, int, (char *, char const *, va_list));
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wchar.h>
 
 #include "macros.h"