Skip to content

Commit 80a8910

Browse files
committed
Ensure read value is a number
1 parent aef65a3 commit 80a8910

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/rpio.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ end
88

99
local function read(path)
1010
local f = io.popen('cat ' .. path, 'r')
11-
local value = f:read('*a')
11+
local value = tonumber(f:read('*a'))
1212
f:close()
1313
return value
1414
end
@@ -56,4 +56,3 @@ return function(which)
5656
end
5757
}
5858
end
59-

0 commit comments

Comments
 (0)