avoid potential array index by -1

Noticed by:	Coverity Prevent analysis tool
This commit is contained in:
sam 2005-03-16 20:40:48 +00:00
parent 0ea8247d55
commit 9b7f94f833

View File

@ -628,7 +628,8 @@ ieee80211_end_scan(struct ieee80211com *ic)
bestchan = i;
break;
}
if (maxrssi[i] < maxrssi[bestchan])
if (bestchan == -1 ||
maxrssi[i] < maxrssi[bestchan])
bestchan = i;
}
if (bestchan != -1) {