Skip to content

Commit

Permalink
Ensure read value is a number
Browse files Browse the repository at this point in the history
  • Loading branch information
gea-migration committed Sep 29, 2016
1 parent aef65a3 commit 80a8910
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rpio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end

local function read(path)
local f = io.popen('cat ' .. path, 'r')
local value = f:read('*a')
local value = tonumber(f:read('*a'))
f:close()
return value
end
Expand Down Expand Up @@ -56,4 +56,3 @@ return function(which)
end
}
end

0 comments on commit 80a8910

Please sign in to comment.