]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/MultihopOscilloscope/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 / MultihopOscilloscope / MultihopOscilloscopeC.nc
index 5179b3500d46aa8a37c9c3ba2a40a0e1a22d8687..a7f39ca62041355d2ea9e79c1667babab6b34023 100644 (file)
@@ -265,7 +265,8 @@ implementation {
       data = 0xffff;
       report_problem();
     }
-    local.readings[reading++] = data;
+    if (reading < NREADINGS)
+      local.readings[reading++] = data;
   }