From e9fa7625f41a28877d5e2d64deb3eb48f3c753ae Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Wed, 12 Aug 2015 22:25:30 +0200 Subject: [PATCH] cc3200: Correct WLAN constructor argument checking. --- cc3200/mods/modwlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc3200/mods/modwlan.c b/cc3200/mods/modwlan.c index 406b49a39a..010cf88d4d 100644 --- a/cc3200/mods/modwlan.c +++ b/cc3200/mods/modwlan.c @@ -822,12 +822,12 @@ STATIC bool wlan_scan_result_is_unique (const mp_obj_list_t *nets, _u8 *bssid) { /// Create a wlan object. See iwconfig for parameters of initialization. STATIC mp_obj_t wlan_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { // check arguments - mp_arg_check_num(n_args, n_kw, 0, MP_ARRAY_SIZE(wlan_iwconfig_args), true); + mp_arg_check_num(n_args, n_kw, 0, 0, true); wlan_obj.base.type = (mp_obj_type_t*)&mod_network_nic_type_wlan; if (n_kw > 0) { mp_map_t kw_args; mp_map_init_fixed_table(&kw_args, n_kw, args); - wlan_iwconfig(1, (const mp_obj_t *)&wlan_obj, &kw_args); + wlan_iwconfig(n_args + 1, (const mp_obj_t *)&wlan_obj, &kw_args); } return &wlan_obj; }