if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
- { free (converted); goto out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted, converted_len);
free (converted);
}
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
- { free (converted); goto out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted, converted_len);
free (converted);
}
if (converted != result + length)
{
ENSURE_ALLOCATION_ELSE (xsum (length, converted_len),
- { free (converted); goto out_of_memory; });
+ { free (converted); goto out_of_memory; });
DCHAR_CPY (result + length, converted, converted_len);
free (converted);
}
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory; });
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
if (w < width && !(flags & FLAG_LEFT))
{
size_t n = width - w;
+# if DCHAR_IS_TCHAR
ENSURE_ALLOCATION (xsum (length, n));
+# else
+ ENSURE_ALLOCATION_ELSE (xsum (length, n),
+ { free (tmpdst); goto out_of_memory; });
+# endif
DCHAR_SET (result + length, ' ', n);
length += n;
}
}
# else
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory; });
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
length += tmpdst_len;
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
{
size_t n = xsum (length, count);
- ENSURE_ALLOCATION (n);
+ ENSURE_ALLOCATION_ELSE (n,
+ { if (tmp != tmpbuf) free (tmp); goto out_of_memory; });
}
/* Append the result. */
goto fail_with_errno;
# endif
ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len),
- { free (tmpdst); goto out_of_memory; });
+ { free (tmpdst); goto out_of_memory; });
DCHAR_CPY (result + length, tmpdst, tmpdst_len);
free (tmpdst);
count = tmpdst_len;