}
/* Otherwise, use phys_port_name as is. */
- if (asprintf(&buf, "n%s", phys_port_name) < 0)
+ buf = strjoin("n", phys_port_name);
+ if (!buf)
return log_oom_debug();
*ret = buf;
if (streq(interf, "0"))
interf = NULL;
- if (asprintf(&buf, "u%s%s%s%s%s",
- ports,
- config ? "c" : "", strempty(config),
- interf ? "i" : "", strempty(interf)) < 0)
+ buf = strjoin("u", ports,
+ config ? "c" : "", strempty(config),
+ interf ? "i" : "", strempty(interf));
+ if (!buf)
return log_oom_debug();
log_device_debug(dev, "USB name identifier: ports=%s config=%s interface=%s %s %s",