Fix MSVC warning: Invalid data: accessing 'm_DeviceName', the readable size is '6240' bytes, but '-240' bytes might be read

This commit is contained in:
Echelon9 2013-09-15 12:49:36 +10:00
parent 21aeffd6c6
commit 9967b72d83
1 changed files with 5 additions and 0 deletions

View File

@ -1085,6 +1085,11 @@ void XBController::ReorderObjects(const char *szDeviceName, int pos)
{
old = v;
break;
} else {
// If old device name was not found, do not continue
// int old will equal -1, which leads to an out-of-bounds
// memory access below
return;
}
}