From: Yu Watanabe Date: Fri, 31 Oct 2025 13:36:41 +0000 (+0900) Subject: dns-rr: use strv_extendf() at one more place X-Git-Tag: v259-rc1~203^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b2b04d6d06d8bd23807bc6e7686512efde01842;p=thirdparty%2Fsystemd.git dns-rr: use strv_extendf() at one more place --- diff --git a/src/shared/dns-rr.c b/src/shared/dns-rr.c index 79600029143..32c26a7612b 100644 --- a/src/shared/dns-rr.c +++ b/src/shared/dns-rr.c @@ -819,21 +819,12 @@ static char *format_types(Bitmap *types) { int r; BITMAP_FOREACH(type, types) { - if (dns_type_to_string(type)) { + if (dns_type_to_string(type)) r = strv_extend(&strv, dns_type_to_string(type)); - if (r < 0) - return NULL; - } else { - char *t; - - r = asprintf(&t, "TYPE%u", type); - if (r < 0) - return NULL; - - r = strv_consume(&strv, t); - if (r < 0) - return NULL; - } + else + r = strv_extendf(&strv, "TYPE%u", type); + if (r < 0) + return NULL; } str = strv_join(strv, " ");