7 #define vsnprintf _vsnprintf
10 int obstack_printf(struct obstack *obst, const char *fmt, ...)
14 size_t size = lengthof(buf);
20 len = vsnprintf(buffer, sizeof(buffer), fmt, ap);
23 /* snprintf should return -1 only in the error case, but older glibcs
24 * and probably other systems are buggy in this respect and return -1 if
25 * the buffer was too small. We only abort for LARGE unrealistic buffer
33 } else if ((size_t)len >= size) {
34 /* If we come here more than once, vsnprintf() returned garbage */
35 assert(buffer == buf);
36 size = (size_t)len + 1;
40 buffer = malloc(buffer, size);
43 obstack_grow(obst, buffer, len);