libusb-1.0 support
[fw/openocd] / src / jtag / tcl.c
index 3b2f83b5aef4b6a3c063cdf2ba82b1c6a9cd4d34..b634ac0db57211440248d3174a529f0e0fd02806 100644 (file)
@@ -166,12 +166,15 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
                }
        } /* validate args */
 
+       assert(e == JIM_OK);
+
        tap = jtag_tap_by_jim_obj(interp, args[1]);
        if (tap == NULL) {
                return JIM_ERR;
        }
 
        num_fields = (argc-2)/2;
+       assert(num_fields > 0);
        fields = malloc(sizeof(struct scan_field) * num_fields);
        for (i = 2; i < argc; i += 2)
        {