From b600ba0123b8af27d2d25e7655b311163afaec91 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 5 May 2017 10:33:23 +1000 Subject: Fix luaL_error callsites - Now that luaL_error does sprintf-like formatting it shouldn't take user input - % now needs to be escaped when passed to luaL_error - Removes several wasteful lua->js->lua string transformations --- src/lutf8lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lutf8lib.js') diff --git a/src/lutf8lib.js b/src/lutf8lib.js index 9e0302f..1a401c4 100644 --- a/src/lutf8lib.js +++ b/src/lutf8lib.js @@ -117,7 +117,7 @@ const byteoffset = function(L) { let posi = n >= 0 ? 1 : s.length + 1; posi = u_posrelat(lauxlib.luaL_optinteger(L, 3, posi), s.length); - lauxlib.luaL_argcheck(L, 1 <= posi && --posi <= s.length, 3, lua.to_luastring("position ot ouf range", true)); + lauxlib.luaL_argcheck(L, 1 <= posi && --posi <= s.length, 3, lua.to_luastring("position out of range", true)); if (n === 0) { /* find beginning of current byte sequence */ -- cgit v1.2.3-54-g00ecf