Index: /trunk/FACT++/src/fscctrl.cc
===================================================================
--- /trunk/FACT++/src/fscctrl.cc	(revision 11844)
+++ /trunk/FACT++/src/fscctrl.cc	(revision 11845)
@@ -242,4 +242,15 @@
         }
 
+        if (volt.size()!=84 || resist.size()!=64)
+        {
+            ostringstream out;
+
+            out << "Corrupted data received (" << volt.size() << " voltages and ";
+            out << resist.size() << "resistances; 84 and 64 expected)";
+            Warn(out);
+            StartRead();
+            return;
+        }
+
         int mapv[] =
         {
@@ -306,8 +317,8 @@
         vector<float> temperatures;
 
-        for (int *pv=mapv; *pv>0; pv++)
+        for (int *pv=mapv; *pv>=0; pv++)
             voltages.push_back(volt[*pv]);
 
-        for (int *pc=mapc; *pc>0; pc++)
+        for (int *pc=mapc; *pc>=0; pc++)
             currents.push_back(volt[*pc]*5);
 
@@ -325,8 +336,8 @@
 
         int idx=0;
-        for (int *ph=maprh; *ph>0; ph++, idx++)
+        for (int *ph=maprh; *ph>=0; ph++, idx++)
             humidities.push_back((volt[*ph]-offrh[idx])*0.0313);
 
-        for (int *pt=mapt; *pt>0; pt++)
+        for (int *pt=mapt; *pt>=0; pt++)
             temperatures.push_back(resist[*pt]>800&&resist[*pt]<2000 ? GetTempPT1000(resist[*pt]) : 0);
 
