Browse Source

fix 'jtag interface' behavior

Without this patch, running "openocd -c 'jtag interface'" segfaults.
Now, it returns the string "undefined" when the interface is unset.
tags/v0.4.0-rc1
Zachary T Welch 14 years ago
parent
commit
5e1b500b17
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/jtag/tcl.c

+ 2
- 1
src/jtag/tcl.c View File

@@ -422,7 +422,8 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
}
Jim_SetResultString(goi.interp, jtag_interface->name, -1);
const char *name = jtag_interface ? jtag_interface->name : NULL;
Jim_SetResultString(goi.interp, name ? : "undefined", -1);
return JIM_OK;
case JTAG_CMD_INIT:
if (goi.argc != 0) {


Loading…
Cancel
Save