diff options
author | Jouni Malinen <j@w1.fi> | 2013-10-26 14:00:57 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2013-10-26 14:49:05 (GMT) |
commit | e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed (patch) | |
tree | 85908522f34532000904ebcc47c331e7f0dfd942 /wpa_supplicant/wpa_cli.c | |
parent | 39044a703348e50d9d35053baf1b9ba3f53efdbf (diff) | |
download | hostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.zip hostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.tar.gz hostap-e7ecab4a3b8bc5696ee6d9779bc9f9a1f8b4b6ed.tar.bz2 |
Use ARRAY_SIZE() macro
Replace the common sizeof(a)/sizeof(a[0]) constructions with a more
readable version.
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r-- | wpa_supplicant/wpa_cli.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index f95f7b1..d793819 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -627,7 +627,7 @@ static char ** wpa_cli_complete_set(const char *str, int pos) "sae_groups", "dtim_period", "beacon_int", "ap_vendor_elements", "ignore_old_scan_res", "freq_list", "external_sim" }; - int i, num_fields = sizeof(fields) / sizeof(fields[0]); + int i, num_fields = ARRAY_SIZE(fields); if (arg == 1) { char **res = os_calloc(num_fields + 1, sizeof(char *)); @@ -2112,7 +2112,7 @@ static char ** wpa_cli_complete_p2p_set(const char *str, int pos) "disc_int", "per_sta_psk", }; - int i, num_fields = sizeof(fields) / sizeof(fields[0]); + int i, num_fields = ARRAY_SIZE(fields); if (arg == 1) { char **res = os_calloc(num_fields + 1, sizeof(char *)); @@ -2927,7 +2927,7 @@ static char ** wpa_list_cmd_list(void) int i, count; struct cli_txt_entry *e; - count = sizeof(wpa_cli_commands) / sizeof(wpa_cli_commands[0]); + count = ARRAY_SIZE(wpa_cli_commands); count += dl_list_len(&p2p_groups); count += dl_list_len(&ifnames); res = os_calloc(count + 1, sizeof(char *)); |