return strv_extendf(strv, "%s=%s", name, value ?: "???");
}
-static char* link_protocol_status(const LinkInfo *info) {
+static char** link_protocol_status(const LinkInfo *info) {
_cleanup_strv_free_ char **s = NULL;
if (strv_extendf(&s, "%sDefaultRoute", plus_minus(info->default_route)) < 0)
info->dnssec_supported ? "supported" : "unsupported") < 0)
return NULL;
- return strv_join(s, " ");
+ return TAKE_PTR(s);
}
-static char* global_protocol_status(const GlobalInfo *info) {
+static char** global_protocol_status(const GlobalInfo *info) {
_cleanup_strv_free_ char **s = NULL;
if (strv_extend_extended_bool(&s, "LLMNR", info->llmnr) < 0)
info->dnssec_supported ? "supported" : "unsupported") < 0)
return NULL;
- return strv_join(s, " ");
+ return TAKE_PTR(s);
}
static int status_ifindex(sd_bus *bus, int ifindex, const char *name, StatusMode mode, bool *empty_line) {
if (r < 0)
return table_log_add_error(r);
- _cleanup_free_ char *pstatus = link_protocol_status(&link_info);
+ _cleanup_strv_free_ char **pstatus = link_protocol_status(&link_info);
if (!pstatus)
return log_oom();
r = table_add_many(table,
- TABLE_STRING, "Protocols:",
- TABLE_STRING, pstatus);
+ TABLE_STRING, "Protocols:",
+ TABLE_STRV_WRAPPED, pstatus);
if (r < 0)
return table_log_add_error(r);
table_set_header(table, false);
- _cleanup_free_ char *pstatus = global_protocol_status(&global_info);
+ _cleanup_strv_free_ char **pstatus = global_protocol_status(&global_info);
if (!pstatus)
return log_oom();
r = table_add_many(table,
- TABLE_STRING, "Protocols:",
+ TABLE_STRING, "Protocols:",
TABLE_SET_ALIGN_PERCENT, 100,
- TABLE_STRING, pstatus);
+ TABLE_STRV_WRAPPED, pstatus);
if (r < 0)
return table_log_add_error(r);