Skip to content

Commit be05866

Browse files
committed
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.
1 parent a2968e8 commit be05866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/udev/udev-builtin-net_id.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ static int dev_pci_slot(sd_device *dev, const LinkInfo *info, NetNames *names) {
443443
s = names->pci_slot;
444444
l = sizeof(names->pci_slot);
445445
if (domain > 0)
446-
l = strpcpyf(&s, l, "P%d", domain);
446+
l = strpcpyf(&s, l, "P%u", domain);
447447
l = strpcpyf(&s, l, "s%"PRIu32, hotplug_slot);
448448
if (func > 0 || is_pci_multifunction(names->pcidev))
449-
l = strpcpyf(&s, l, "f%d", func);
449+
l = strpcpyf(&s, l, "f%u", func);
450450
if (!isempty(info->phys_port_name))
451451
l = strpcpyf(&s, l, "n%s", info->phys_port_name);
452452
else if (dev_port > 0)

0 commit comments

Comments
 (0)