Пример #1
0
static uint8_t *
my_asnprintf (uint8_t *resultbuf, size_t *lengthp, const char *format, ...)
{
  va_list args;
  uint8_t *ret;

  va_start (args, format);
  ret = u8_vasnprintf (resultbuf, lengthp, format, args);
  va_end (args);
  return ret;
}
static uint8_t *
my_xasprintf (const char *format, ...)
{
  va_list args;
  size_t length;
  uint8_t *ret;

  va_start (args, format);
  ret = u8_vasnprintf (NULL, &length, format, args);
  va_end (args);
  if (ret != NULL)
    ASSERT (length == u8_strlen (ret));
  return ret;
}