+2008-06-10 Guillem Jover <guillem@debian.org>
+
+ * lib/varbuf.c (varbufprintf): Use varbufvprintf instead of
+ reimplementing it.
+
2008-06-09 Guillem Jover <guillem@debian.org>
* scripts/Dpkg/BuildOptions.pm (parse, set): Use space as the
}
int varbufprintf(struct varbuf *v, const char *fmt, ...) {
- size_t ou;
int r;
va_list al;
- ou= v->used;
- v->used+= strlen(fmt);
+ va_start(al, fmt);
+ r = varbufvprintf(v, fmt, al);
+ va_end(al);
- do {
- varbufextend(v);
- va_start(al,fmt);
- r= vsnprintf(v->buf+ou,v->size-ou,fmt,al);
- va_end(al);
- if (r < 0) r= (v->size-ou+1) * 2;
- v->used= ou+r;
- } while (r >= (int)(v->size - ou - 1));
return r;
}