mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-13 05:31:28 +00:00
libudev: fix sysnum logic for digit-only device names
This commit is contained in:
committed by
Kay Sievers
parent
3feeb77c97
commit
babcf3cb22
@@ -936,8 +936,13 @@ int udev_device_set_syspath(struct udev_device *udev_device, const char *syspath
|
||||
}
|
||||
|
||||
/* trailing number */
|
||||
while (isdigit(udev_device->sysname[--len]))
|
||||
while (len > 0 && isdigit(udev_device->sysname[--len]))
|
||||
udev_device->sysnum = &udev_device->sysname[len];
|
||||
|
||||
/* sysname is completely numeric */
|
||||
if (len == 0)
|
||||
udev_device->sysnum = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user