* lib/vasnprintf.c (VASNPRINTF): When processing %s with !has_precision
and !has_width, don't call abort() if there is a conversion failure.
+2023-03-31 Bruno Haible <bruno@clisp.org>
+
+ vasnwprintf: Fix crash upon conversion failure when processing %s.
+ * lib/vasnprintf.c (VASNPRINTF): When processing %s with !has_precision
+ and !has_width, don't call abort() if there is a conversion failure.
+
2023-03-30 Bruno Haible <bruno@clisp.org>
Avoid test failures on Android.
# else
count = mbtowc (&wc, arg, arg_end - arg);
# endif
- if (count <= 0)
- /* mbrtowc not consistent with mbrlen, or mbtowc
- not consistent with mblen. */
+ if (count == 0)
+ /* mbrtowc not consistent with strlen. */
abort ();
+ if (count < 0)
+ /* Invalid or incomplete multibyte character. */
+ goto fail_with_EILSEQ;
ENSURE_ALLOCATION (xsum (length, 1));
result[length++] = wc;
arg += count;