elua: some more checking for no value

This commit is contained in:
Daniel Kolesa 2014-05-09 13:10:23 +01:00 committed by Daniel Kolesa
parent 0c7b3e5d6b
commit 5eccfb29b7
1 changed files with 3 additions and 0 deletions

View File

@ -295,6 +295,9 @@ getmetatable("").__mod = function(fmts, params)
nbuf:append_char(c)
c, s = s[0], s + 1
end
if argn > #params then
fmterr(idx, "no value")
end
local stat, val = pcall(fmt, "%" .. tostr(nbuf),
params[argn])
nbuf:clear()