From 245e582eaad5293fc5b8d4620d140a527c3b42c4 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 22:05:29 +0100 Subject: Fixed string.format pattern with '.' --- src/lstrlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lstrlib.js b/src/lstrlib.js index 2e623b6..13e325e 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -361,7 +361,7 @@ const str_format = function(L) { } else { let zero = s.indexOf(0); lauxlib.luaL_argcheck(L, zero < 0 || zero === s.length - 1, arg, "string contains zeros"); - if (form.indexOf('.') < 0 && s.length >= 100) { + if (form.indexOf('.'.charCodeAt(0)) < 0 && s.length >= 100) { /* no precision and string is too long to be formatted */ concat(b, s); /* keep entire string */ lapi.lua_pop(L, 1); /* remove result from 'luaL_tolstring' */ -- cgit v1.2.3-70-g09d2