format-util/sd-bus: do not ignore snprintf result

This commit is contained in:
Luca Boccassi
2021-08-20 18:15:35 +01:00
parent e4193309c4
commit 272fff7d84
2 changed files with 6 additions and 10 deletions

View File

@@ -15,9 +15,9 @@ char *format_ifname_full(int ifindex, char buf[static IF_NAMESIZE + 1], FormatIf
return NULL;
if (FLAGS_SET(flag, FORMAT_IFNAME_IFINDEX_WITH_PERCENT))
snprintf(buf, IF_NAMESIZE + 1, "%%%d", ifindex);
assert(snprintf_ok(buf, IF_NAMESIZE + 1, "%%%d", ifindex));
else
snprintf(buf, IF_NAMESIZE + 1, "%d", ifindex);
assert(snprintf_ok(buf, IF_NAMESIZE + 1, "%d", ifindex));
return buf;
}