vsnprintf() can, under some circumstances, return negative value, namely
during encoding errors when converting wchars to multi-byte characters.
This would then wreak havoc in the arithmetics we do following the
vsnprintf() call. However, since we never do any wchar shenanigans in
our code it should never happen.
Let's encode this assumption into the code as an assert(), similarly how
we already do this in other places (like strextendf_with_separator()).
i = vsnprintf(*dest, size, src, va);
va_end(va);
+ assert(i >= 0);
+
if (i < (int) size) {
*dest += i;
size -= i;