]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: Fix regression in mesh_param input parsing
authorColin McCabe <colin@cozybit.com>
Sat, 10 Jan 2009 01:13:16 +0000 (17:13 -0800)
committerJohannes Berg <johannes@sipsolutions.net>
Sat, 10 Jan 2009 09:14:00 +0000 (10:14 +0100)
In the iw tool, don't crash on bad arguments to "iw dev mesh set mesh_param"

mesh.c

diff --git a/mesh.c b/mesh.c
index d6edf3fcba8aff9a8b899f111ffd4cee8731e674..f66336322392673cae451484891d4f42dfe6f350 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -192,9 +192,10 @@ static const struct mesh_param_descr* find_mesh_param(int argc, char **argv,
 
        /* Find out what mesh parameter we want to change. */
        mdescr = NULL;
-       for (i = 0; ARRAY_SIZE(_mesh_param_descrs); i++)
+       for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
                if (!strcmp(_mesh_param_descrs[i].name, argv[0]))
                        return _mesh_param_descrs + i;
+       }
 
        if (!mdescr) {
                printf("Mesh_param must be one of: ");