don't log normal case as error

This commit is contained in:
Eric House 2015-02-20 07:52:19 -08:00
parent 59bf77c871
commit 958ca38002

View file

@ -414,14 +414,15 @@ getClientIndex( const uint8_t** bufpp, const uint8_t* end,
uint8_t result = 0; uint8_t result = 0;
uint8_t clientIndx; uint8_t clientIndx;
if ( getNetByte( bufpp, end, &clientIndx ) ) { if ( getNetByte( bufpp, end, &clientIndx ) ) {
if ( 0 < clientIndx && clientIndx < nPlayersT ) { if ( 0 == clientIndx ) {
result = 1 + clientIndx; // postgres arrays are 1-based // unset on device: leave it alone
} else { } else if ( clientIndx >= nPlayersT ) {
logf( XW_LOGERROR, "%s: bogus clientIndx %d > nPlayersT %d", logf( XW_LOGERROR, "%s: bogus clientIndx %d > nPlayersT %d",
__func__, clientIndx, nPlayersT ); __func__, clientIndx, nPlayersT );
} else {
result = 1 + clientIndx; // postgres arrays are 1-based
} }
} }
// logf( XW_LOGINFO, "%s() => %d", __func__, result );
return result; return result;
} }