summaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-10 08:57:35 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-10 08:57:35 +0000
commitbfa8c1b3213d5d2541648f7f3db460f81d949fb1 (patch)
tree5e18e91464a09e33ec6afc4e6a8bf9430591957e /src/openocd.c
parent313547ddd66b3dc7a8f1c6261621d26939d9d524 (diff)
downloadopenocd+libswd-bfa8c1b3213d5d2541648f7f3db460f81d949fb1.tar.gz
openocd+libswd-bfa8c1b3213d5d2541648f7f3db460f81d949fb1.tar.bz2
openocd+libswd-bfa8c1b3213d5d2541648f7f3db460f81d949fb1.tar.xz
openocd+libswd-bfa8c1b3213d5d2541648f7f3db460f81d949fb1.zip
SEGFAULT fix for syntax error.
git-svn-id: svn://svn.berlios.de/openocd/trunk@783 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 50eb99e0..f4aa4517 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -360,10 +360,14 @@ int jim_command(command_context_t *context, char *line)
if (retcode == JIM_ERR) {
Jim_PrintErrorMessage(interp);
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)
{
- return t;
- }
+ if (Jim_GetLong(interp, openocd_result, &t)==JIM_OK)
+ {
+ return t;
+ }
+ }
return ERROR_FAIL;
}
const char *result;