]> git.sur5r.net Git - openocd/commitdiff
SEGFAULT fix for syntax error.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 10 Jul 2008 08:57:35 +0000 (08:57 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 10 Jul 2008 08:57:35 +0000 (08:57 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@783 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/openocd.c

index 50eb99e0b1a3c518437dc0a8206e9be98c219d90..f4aa451728a050cea16230440f2a919c00149676 100644 (file)
@@ -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;