aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-10 20:53:36 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-10 20:53:36 (GMT)
commit20766f2007f8b77fb7a657fc9f795a9ebaf3aae4 (patch)
tree968d8a6ca5ff1f5e0679f5f587cd68c473b8d523 /wpa_supplicant/bss.c
parentf5455a2dbdaf614a151e68ca0c2c547bcf370ba9 (diff)
downloadhostap-20766f2007f8b77fb7a657fc9f795a9ebaf3aae4.zip
hostap-20766f2007f8b77fb7a657fc9f795a9ebaf3aae4.tar.gz
hostap-20766f2007f8b77fb7a657fc9f795a9ebaf3aae4.tar.bz2
Make wpa_bss_get_max_rate() a bit more readable with a local variable
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 599879d..b1d9b67 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -570,22 +570,25 @@ int wpa_bss_get_max_rate(const struct wpa_bss *bss)
int wpa_bss_get_bit_rates(const struct wpa_bss *bss, u8 **rates)
{
const u8 *ie, *ie2;
- int i, j, len;
+ int i, j;
+ unsigned int len;
+ u8 *r;
ie = wpa_bss_get_ie(bss, WLAN_EID_SUPP_RATES);
ie2 = wpa_bss_get_ie(bss, WLAN_EID_EXT_SUPP_RATES);
len = (ie ? ie[1] : 0) + (ie2 ? ie2[1] : 0);
- *rates = os_malloc(len);
- if (!*rates)
+ r = os_malloc(len);
+ if (!r)
return -1;
for (i = 0; ie && i < ie[1]; i++)
- (*rates)[i] = ie[i + 2] & 0x7f;
+ r[i] = ie[i + 2] & 0x7f;
for (j = 0; ie2 && j < ie2[1]; j++)
- (*rates)[i + j] = ie2[j + 2] & 0x7f;
+ r[i + j] = ie2[j + 2] & 0x7f;
+ *rates = r;
return len;
}