1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00

udev/net_id: fix signedness in format string

Both variables are unsigned. In practice those numbers cannot be large
enough to become negative, but let's use the correct type anyway.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-12-17 11:29:57 +01:00
parent a2968e8366
commit be0586610e

View File

@ -443,10 +443,10 @@ static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) {
s = names->pci_slot;
l = sizeof(names->pci_slot);
if (domain > 0)
l = strpcpyf(&s, l, "P%d", domain);
l = strpcpyf(&s, l, "P%u", domain);
l = strpcpyf(&s, l, "s%"PRIu32, hotplug_slot);
if (func > 0 || is_pci_multifunction(names->pcidev))
l = strpcpyf(&s, l, "f%d", func);
l = strpcpyf(&s, l, "f%u", func);
if (!isempty(info->phys_port_name))
l = strpcpyf(&s, l, "n%s", info->phys_port_name);
else if (dev_port > 0)