+2023-01-28 Bruno Haible <bruno@clisp.org>
+
+ vasnprintf-posix: Fix negative width handling for %ls directive.
+ Reported by clang via Po Lu <luangruo@yahoo.com>.
+ * lib/vasnprintf.c (VASNPRINTF): In the code for %ls in vasnprintf and
+ for %s in vasnwprintf, test for the FLAG_LEFT bit in the flags variable.
+
2023-01-28 Bruno Haible <bruno@clisp.org>
Avoid clang warnings regarding [[__nodiscard__]].
characters = 0;
}
- if (characters < width && !(dp->flags & FLAG_LEFT))
+ if (characters < width && !(flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
}
}
- if (characters < width && (dp->flags & FLAG_LEFT))
+ if (characters < width && (flags & FLAG_LEFT))
{
size_t n = width - characters;
ENSURE_ALLOCATION (xsum (length, n));
/* w doesn't matter. */
w = 0;
- if (w < width && !(dp->flags & FLAG_LEFT))
+ if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));
length += tmpdst_len;
# endif
- if (w < width && (dp->flags & FLAG_LEFT))
+ if (w < width && (flags & FLAG_LEFT))
{
size_t n = width - w;
ENSURE_ALLOCATION (xsum (length, n));