]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dns-rr: use strv_extendf() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Oct 2025 13:36:41 +0000 (22:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 31 Oct 2025 15:59:41 +0000 (00:59 +0900)
src/shared/dns-rr.c

index 796000291436be7d416933f1d4de1ef066c66802..32c26a7612b8d5dcb715558c8ef618c90885c5a6 100644 (file)
@@ -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, " ");