while(i < GraphTraceLen)\r
{\r
// measure from low to low\r
- while(GraphBuffer[i] > low)\r
+ while((GraphBuffer[i] > low) && (i<GraphTraceLen))\r
++i;\r
start= i;\r
- while(GraphBuffer[i] < high)\r
+ while((GraphBuffer[i] < high) && (i<GraphTraceLen))\r
++i;\r
- while(GraphBuffer[i] > low)\r
+ while((GraphBuffer[i] > low) && (i<GraphTraceLen))\r
++i;\r
+ if (j>(MAX_GRAPH_TRACE_LEN/64)) {\r
+ break;\r
+ }\r
tmpbuff[j++]= i - start;\r
}\r
\r
-\r
/* look for data start - should be 2 pairs of LW (pulses of 192,128) */\r
start= -1;\r
skip= 0;\r
\r
/* skip over the remainder of the LW */\r
skip += tmpbuff[i+1]+tmpbuff[i+2];\r
- while(GraphBuffer[skip] > low)\r
+ while(skip < MAX_GRAPH_TRACE_LEN && GraphBuffer[skip] > low)\r
++skip;\r
skip += 8;\r
\r
if (res == 2) c.ext3=0;\r
if (res<2)\r
PrintToScrollback("Please specify 2 or three hex strings, eg 0x1234 0x5678");\r
- else \r
+ else\r
SendCommand(&c, FALSE);\r
}\r
\r