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:
Michael Lotz 2011-06-02 13:04:14 +00:00
parent 393ca9a124
commit a00ac73989
1 changed files with 2 additions and 1 deletions

View File

@ -219,7 +219,8 @@ BJoystick::GetDeviceName(int32 index, char *name, size_t bufSize)
if (fDevices == NULL) if (fDevices == NULL)
return B_NO_INIT; return B_NO_INIT;
if (index >= fDevices->CountItems()) // CountDevices() also calls ScanDevices() and therefore updates our list.
if (index >= CountDevices())
return B_BAD_INDEX; return B_BAD_INDEX;
if (name == NULL) if (name == NULL)