ignore client index of 0, since it means the device needs a slot

assigned.
This commit is contained in:
Eric House 2014-12-08 06:22:30 -08:00
parent f84f9aa85f
commit c70fcf64a7

View file

@ -414,7 +414,7 @@ getClientIndex( const uint8_t** bufpp, const uint8_t* end,
uint8_t result = 0;
uint8_t clientIndx;
if ( getNetByte( bufpp, end, &clientIndx ) ) {
if ( clientIndx < nPlayersT ) {
if ( 0 < clientIndx && clientIndx < nPlayersT ) {
result = 1 + clientIndx; // postgres arrays are 1-based
} else {
logf( XW_LOGERROR, "%s: bogus clientIndx %d > nPlayersT %d",