X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-common%2Fmalloc.c;h=52e0962df25a25607f221435d2f16593b5fd8222;hb=c75a6b480b047abc73ee7afd912aef249e9da8e3;hp=9b0e22e12b70ae7aa88065a75c2a2ef59232efae;hpb=7ada090e70d25937d27b2e93b0dab4d9d68c5d23;p=catta diff --git a/avahi-common/malloc.c b/avahi-common/malloc.c index 9b0e22e..52e0962 100644 --- a/avahi-common/malloc.c +++ b/avahi-common/malloc.c @@ -192,7 +192,7 @@ void avahi_set_allocator(const AvahiAllocator *a) { } char *avahi_strdup_vprintf(const char *fmt, va_list ap) { - size_t len = 100; + size_t len = 80; char *buf; assert(fmt); @@ -203,8 +203,13 @@ char *avahi_strdup_vprintf(const char *fmt, va_list ap) { for (;;) { int n; char *nbuf; + va_list ap2; + + va_copy (ap2, ap); - n = vsnprintf(buf, len, fmt, ap); + n = vsnprintf(buf, len, fmt, ap2); + + va_end (ap2); if (n >= 0 && n < (int) len) return buf;