From 783f2967e23e6481941c1bf1e73897c66cb4195a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 27 Feb 2021 18:12:09 +0100 Subject: [PATCH] string-buffer: Fixes. * modules/string-buffer (License): Change to LGPL. * tests/test-string-buffer.c (main): Add another sb_appendf call, that is more likely to fail. --- ChangeLog | 7 +++++++ modules/string-buffer | 2 +- tests/test-string-buffer.c | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b5d7c1aed..9bc60f88e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-02-27 Bruno Haible + + string-buffer: Fixes. + * modules/string-buffer (License): Change to LGPL. + * tests/test-string-buffer.c (main): Add another sb_appendf call, that + is more likely to fail. + 2021-02-25 Bernhard Voelker gitlog-to-changelog: output SHA in "empty commit message" warning diff --git a/modules/string-buffer b/modules/string-buffer index 4e7827c817..54da1db988 100644 --- a/modules/string-buffer +++ b/modules/string-buffer @@ -20,7 +20,7 @@ Include: "string-buffer.h" License: -LGPLv2+ +LGPL Maintainer: all diff --git a/tests/test-string-buffer.c b/tests/test-string-buffer.c index 797355945b..ecf516012c 100644 --- a/tests/test-string-buffer.c +++ b/tests/test-string-buffer.c @@ -90,12 +90,19 @@ main () free (s); } - /* Test printf-like formatting failure. */ + /* Test printf-like formatting failure. + On all systems except AIX, trying to convert the wide-character 0x76543210 + to a multibyte string (in the "C" locale) fails. + On all systems where REPLACE_VSNPRINTF=1 (this includes AIX), i.e. where + the Gnulib implementation of vsnprintf() is used), invalid format + directives make the *printf call fail. */ { struct string_buffer buffer; sb_init (&buffer); sb_append (&buffer, "<"); + sb_appendf (&buffer, "%lc", 0x76543210); + sb_append (&buffer, "|"); sb_appendf (&buffer, invalid_format_string_1, 1); sb_append (&buffer, "|"); sb_appendf (&buffer, invalid_format_string_2, 2);