From 912f25aa49cc82f9c0d8b8bf1b7b927ff070b6b8 Mon Sep 17 00:00:00 2001 From: cancel Date: Wed, 5 Feb 2020 00:54:01 +0900 Subject: [PATCH] Fix naming mixup in oso.c for osocatprintf/osoputprintf Oops. Noticed once we actually needed to use it for its intended purpose. --- thirdparty/oso.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/thirdparty/oso.c b/thirdparty/oso.c index 30633ee..f4785dc 100644 --- a/thirdparty/oso.c +++ b/thirdparty/oso.c @@ -123,12 +123,22 @@ void osoputoso(oso **p, oso const *other) { osoputlen(p, (char const *)other, OSO_HDR(other)->len); } void osoputvprintf(oso **p, char const *fmt, va_list ap) { - *p = oso_impl_catvprintf(*p, fmt, ap); + oso *s = *p; + if (s) { + OSO_HDR(s)->len = 0; + ((char *)s)[0] = '\0'; + } + *p = oso_impl_catvprintf(s, fmt, ap); } void osoputprintf(oso **p, char const *fmt, ...) { + oso *s = *p; + if (s) { + OSO_HDR(s)->len = 0; + ((char *)s)[0] = '\0'; + } va_list ap; va_start(ap, fmt); - *p = oso_impl_catvprintf(*p, fmt, ap); + *p = oso_impl_catvprintf(s, fmt, ap); va_end(ap); } void osocat(oso **p, char const *cstr) { osocatlen(p, cstr, strlen(cstr)); } @@ -151,22 +161,12 @@ void osocatoso(oso **p, oso const *other) { osocatlen(p, (char const *)other, OSO_HDR(other)->len); } void osocatvprintf(oso **p, char const *fmt, va_list ap) { - oso *s = *p; - if (s) { - OSO_HDR(s)->len = 0; - ((char *)s)[0] = '\0'; - } - *p = oso_impl_catvprintf(s, fmt, ap); + *p = oso_impl_catvprintf(*p, fmt, ap); } void osocatprintf(oso **p, char const *fmt, ...) { - oso *s = *p; - if (s) { - OSO_HDR(s)->len = 0; - ((char *)s)[0] = '\0'; - } va_list ap; va_start(ap, fmt); - *p = oso_impl_catvprintf(s, fmt, ap); + *p = oso_impl_catvprintf(*p, fmt, ap); va_end(ap); } void osoclear(oso **p) {