]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/Oscilloscope/OscilloscopeC.nc
don't let reading go past the end of the array in the (unlikely but we believe possib...
[tinyos-2.x.git] / apps / Oscilloscope / OscilloscopeC.nc
index c4e0a1c0dc90ab0949860478dc91095e0f93189b..3003b594133ea8dccb2ca4be3825a3679703f82f 100644 (file)
@@ -136,6 +136,7 @@ implementation
        data = 0xffff;
        report_problem();
       }
-    local.readings[reading++] = data;
+    if (reading < NREADINGS) 
+      local.readings[reading++] = data;
   }
 }