elua: format bug fix
authorDaniel Kolesa <quaker66@gmail.com>
Fri, 9 May 2014 12:08:32 +0000 (13:08 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:51 +0000 (15:48 +0100)
src/bin/elua/core/util.lua

index d6b32c2a3af3b28b67bf4a6d40f36dfa538c373b..f3bc39e47a1ccb677daece918b20a7fb0a3ea046 100644 (file)
@@ -185,7 +185,7 @@ local error = error
 local type  = type
 local tostr = tostring
 
-local bytes = { ("cdeEfgGiopuxXsq"):byte() }
+local bytes = { ("cdeEfgGiopuxXsq"):byte(1, #("cdeEfgGiopuxXsq")) }
 for i, v in ipairs(bytes) do bytes[v] = true end
 
 local Str_Buf = ffi.metatype("Str_Buf", {
@@ -270,7 +270,7 @@ getmetatable("").__mod = function(fmts, params)
                     nbuf:append_char(c)
                     c, s = s[0], s + 1
                 end
-                if bytes[c] then
+                if not bytes[c] then
                     buf:append_str(n)
                     buf:append_char(36) -- $
                     buf:append_char(c)