[fsync] add port numbering check for phy_to_log

This commit is contained in:
Bart Van Der Meerssche 2011-01-28 14:43:55 +01:00
parent 688df77ffa
commit 8ff7770f0a
1 changed files with 6 additions and 1 deletions

View File

@ -150,7 +150,12 @@ for i = 1, MAX_SENSORS do
local ports = flukso[tostring(i)].port or {}
for j = 1, #ports do
if tonumber(ports[j]) <= MAX_SENSORS then
phy_to_log[toc(tonumber(ports[j]))] = toc(i)
else
print(string.format('Error. Port numbering in sensor %s should be less than or equal to max_sensors (%s)', i, MAX_SENSORS))
os.exit(4)
end
end
end
end