diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-05 10:33:23 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-05 10:33:23 +1000 |
commit | b600ba0123b8af27d2d25e7655b311163afaec91 (patch) | |
tree | 082377211fe92fdd2e60c521aecaf0ad2cd64f6f /src/lutf8lib.js | |
parent | 84a0982085967895e9bb5e5439c09960840da2d5 (diff) | |
download | fengari-b600ba0123b8af27d2d25e7655b311163afaec91.tar.gz fengari-b600ba0123b8af27d2d25e7655b311163afaec91.tar.bz2 fengari-b600ba0123b8af27d2d25e7655b311163afaec91.zip |
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
Diffstat (limited to 'src/lutf8lib.js')
-rw-r--r-- | src/lutf8lib.js | 2 |
1 files changed, 1 insertions, 1 deletions
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 */ |