From 90ae0f2bb8d53500f5c9d06e2dc1a18d5a5d0cf5 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sat, 4 Jul 2009 02:18:51 +0300 Subject: libdrm: Fix pci id numbers to unsigned so code won't mix signed/unsigned integers. --- libdrm/xf86drm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libdrm/xf86drm.c') diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 2b1604b3..1a5cee4a 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -241,22 +241,22 @@ static int drmMatchBusID(const char *id1, const char *id2) /* Try to match old/new-style PCI bus IDs. */ if (strncasecmp(id1, "pci", 3) == 0) { - int o1, b1, d1, f1; - int o2, b2, d2, f2; + unsigned int o1, b1, d1, f1; + unsigned int o2, b2, d2, f2; int ret; - ret = sscanf(id1, "pci:%04x:%02x:%02x.%d", &o1, &b1, &d1, &f1); + ret = sscanf(id1, "pci:%04x:%02x:%02x.%u", &o1, &b1, &d1, &f1); if (ret != 4) { o1 = 0; - ret = sscanf(id1, "PCI:%d:%d:%d", &b1, &d1, &f1); + ret = sscanf(id1, "PCI:%u:%u:%u", &b1, &d1, &f1); if (ret != 3) return 0; } - ret = sscanf(id2, "pci:%04x:%02x:%02x.%d", &o2, &b2, &d2, &f2); + ret = sscanf(id2, "pci:%04x:%02x:%02x.%u", &o2, &b2, &d2, &f2); if (ret != 4) { o2 = 0; - ret = sscanf(id2, "PCI:%d:%d:%d", &b2, &d2, &f2); + ret = sscanf(id2, "PCI:%u:%u:%u", &b2, &d2, &f2); if (ret != 3) return 0; } -- cgit v1.2.3