Crossported from master branch because it is a dependency for svec,
which is needed by the switch UI, which is wanted in 0.4.
return s;
}
+void *
+x2nrealloc(void *p, size_t *n, size_t s)
+{
+ *n = *n == 0 ? 1 : 2 * *n;
+ return xrealloc(p, *n * s);
+}
+
char *
xasprintf(const char *format, ...)
{
char *xstrdup(const char *);
char *xasprintf(const char *format, ...) PRINTF_FORMAT(1, 2);
char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0);
+void *x2nrealloc(void *p, size_t *n, size_t s);
#ifndef HAVE_STRLCPY
void strlcpy(char *dst, const char *src, size_t size);