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 2009-01-28 18:37:46 +00:00
parent 49cfcf2ff6
commit dce44e3d8e

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