Fix array indexation

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29640 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2009-03-21 22:06:15 +00:00
parent 3fdaa5bf72
commit 3226176456
+7 -6
View File
@@ -569,6 +569,7 @@ GetLmpVersion(uint16 ver)
const char*
GetCommand(uint16 command)
{
// TODO: BT implementations beyond 2.1
// could specify new commands with OCF numbers
// beyond the boundaries of the arrays and crash.
@@ -576,27 +577,27 @@ GetCommand(uint16 command)
// our control.
switch (GET_OPCODE_OGF(command)) {
case OGF_LINK_CONTROL:
return linkControlCommands[GET_OPCODE_OCF(command)];
return linkControlCommands[GET_OPCODE_OCF(command)-1];
break;
case OGF_LINK_POLICY:
return linkPolicyCommands[GET_OPCODE_OCF(command)];
return linkPolicyCommands[GET_OPCODE_OCF(command)-1];
break;
case OGF_CONTROL_BASEBAND:
return controllerBasebandCommands[GET_OPCODE_OCF(command)];
return controllerBasebandCommands[GET_OPCODE_OCF(command)-1];
break;
case OGF_INFORMATIONAL_PARAM:
return informationalParametersCommands[GET_OPCODE_OCF(command)];
return informationalParametersCommands[GET_OPCODE_OCF(command)-1];
break;
case OGF_STATUS_PARAM:
return statusParametersCommands[GET_OPCODE_OCF(command)];
return statusParametersCommands[GET_OPCODE_OCF(command)-1];
break;
case OGF_TESTING_CMD:
return testingCommands[GET_OPCODE_OCF(command)];
return testingCommands[GET_OPCODE_OCF(command)-1];
break;
default:
return "Unknown command";