/* Write as much NUL terminated output to DEST as possible. */
if (dest_size != 0)
{
- size_t start_spaces, end_spaces;
+ size_t start_spaces, end_spaces, space_left;
char *dest_end = dest + dest_size - 1;
switch (align)
}
dest = mbs_align_pad (dest, dest_end, start_spaces);
- size_t space_left = dest_end - dest;
+ space_left = dest_end - dest;
dest = mempcpy (dest, str_to_print, MIN (n_used_bytes, space_left));
mbs_align_pad (dest, dest_end, end_spaces);
}
while (req >= size)
{
+ char *nbuf;
size = req + 1; /* Space for NUL. */
- char *nbuf = realloc (buf, size);
+ nbuf = realloc (buf, size);
if (nbuf == NULL)
{
free (buf);
enum {
/* Use unibyte mode for invalid multibyte strings or
or when heap memory is exhausted. */
- MBA_UNIBYTE_FALLBACK = 0x0001,
+ MBA_UNIBYTE_FALLBACK = 0x0001
#if 0 /* Other possible options. */
/* Skip invalid multibyte chars rather than failing */