use ARRAY_SIZE macro
[fw/openocd] / src / jtag / tcl.c
index bc290788d3b854a16645fc99b7c351129232bb37..e755dd7ef2b7ff983bf892f26ead0b128dd9643c 100644 (file)
@@ -1304,7 +1304,7 @@ static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *ar
 {
        tap_state_t states[8];
 
-       if ((argc < 2) || ((size_t)argc > (sizeof(states)/sizeof(*states) + 1)))
+       if ((argc < 2) || ((size_t)argc > (ARRAY_SIZE(states) + 1)))
        {
                Jim_WrongNumArgs(interp, 1, args, "wrong arguments");
                return JIM_ERR;