aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/util.c')
-rw-r--r--bootstrap/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootstrap/util.c b/bootstrap/util.c
index 4aebbe6..855091a 100644
--- a/bootstrap/util.c
+++ b/bootstrap/util.c
@@ -61,13 +61,13 @@ xrealloc(void *p, size_t n) {
char *
xasprintf(const char *fmt, ...) {
va_list ap, aq;
- int n = 32, m;
+ int n = 16, m;
char *str = xcalloc(n, 1);
va_start(ap, fmt);
m = vsnprintf(str, n, fmt, ap) + 1;
+ str = xrealloc(str, m);
if (m > n) {
va_copy(aq, ap);
- str = xrealloc(str, m);
vsprintf(str, fmt, ap);
va_end(aq);
}