]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/MultihopOscilloscopeLqi/MultihopOscilloscopeC.nc
don't let reading go past the end of the array in the (unlikely but we believe possib...
[tinyos-2.x.git] / apps / MultihopOscilloscopeLqi / MultihopOscilloscopeC.nc
index 17edb6b78c6c8d50c5a27e19f47c04039981a63c..5235446299051e288da27fd38ae3aad6e2036d08 100644 (file)
@@ -267,7 +267,8 @@ implementation {
       data = 0xffff;
       report_problem();
     }
-    local.readings[reading++] = data;
+    if (reading < NREADINGS)
+      local.readings[reading++] = data;
   }