diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index ceea19303..dd2be1e5a 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -169,7 +169,10 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args return JIM_ERR; num_fields = (argc-2)/2; - assert(num_fields > 0); + if (num_fields <= 0) { + Jim_SetResultString(interp, "drscan: no scan fields supplied", -1); + return JIM_ERR; + } fields = malloc(sizeof(struct scan_field) * num_fields); for (i = 2; i < argc; i += 2) { long bits;