SEGFAULT fix for syntax error.

git-svn-id: svn://svn.berlios.de/openocd/trunk@783 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-07-10 08:57:35 +00:00
parent 313547ddd6
commit bfa8c1b321
1 changed files with 7 additions and 3 deletions

View File

@ -360,10 +360,14 @@ int jim_command(command_context_t *context, char *line)
if (retcode == JIM_ERR) { if (retcode == JIM_ERR) {
Jim_PrintErrorMessage(interp); Jim_PrintErrorMessage(interp);
long t; long t;
if (Jim_GetLong(interp, Jim_GetVariableStr(interp, "openocd_result", JIM_ERRMSG), &t)==JIM_OK) Jim_Obj *openocd_result=Jim_GetVariableStr(interp, "openocd_result", JIM_ERRMSG);
if (openocd_result)
{
if (Jim_GetLong(interp, openocd_result, &t)==JIM_OK)
{ {
return t; return t;
} }
}
return ERROR_FAIL; return ERROR_FAIL;
} }
const char *result; const char *result;