change null_getradiocaps to return the actual count of channels instead

of the true number; otherwise the caller may use the count to do things
with the data it should not (e.g. sort the channel table)
This commit is contained in:
Sam Leffler 2009-01-28 18:37:46 +00:00
parent 9a734a28c9
commit a6f34da70b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187834

View File

@ -48,10 +48,10 @@ null_getradiocaps(struct ieee80211com *ic, int maxchan,
int *n, struct ieee80211_channel *c)
{
/* just feed back the current channel list */
*n = ic->ic_nchans; /* XXX return count copied? */
if (maxchan > ic->ic_nchans)
maxchan = ic->ic_nchans;
memcpy(c, ic->ic_channels, maxchan*sizeof(struct ieee80211_channel));
*n = maxchan;
}
static int