Ensure that a GetDeviceName() call triggers a ScanDevices() as well, as it can
be called without calling CountDevices(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41869 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
393ca9a124
commit
a00ac73989
|
@ -219,7 +219,8 @@ BJoystick::GetDeviceName(int32 index, char *name, size_t bufSize)
|
|||
if (fDevices == NULL)
|
||||
return B_NO_INIT;
|
||||
|
||||
if (index >= fDevices->CountItems())
|
||||
// CountDevices() also calls ScanDevices() and therefore updates our list.
|
||||
if (index >= CountDevices())
|
||||
return B_BAD_INDEX;
|
||||
|
||||
if (name == NULL)
|
||||
|
|
Loading…
Reference in New Issue