Find period delimiter when sysfs device symlink target lacks a colon.

This commit is contained in:
blitter
2021-07-25 22:02:11 -07:00
parent 9778904dba
commit d0bbf0dc05

View File

@@ -242,7 +242,14 @@ int32_t GetDeviceType(void* device_ctx)
}
ret = 0;
chrptr = strchr(dev_path, ':') - 1;
chrptr = strchr(dev_path, ':');
if(!chrptr)
{
chrptr = strrchr(dev_path, '.');
}
chrptr--;
while(chrptr != dev_path)
{