diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-05 13:07:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-05 13:07:46 -0300 |
commit | 297512b34c2d16bb7827ef61bd7b14467bfa4ecf (patch) | |
tree | c18fd2cb2f59476aa4411a0ef33a1c7834c7683d /lutf8lib.c | |
parent | 2ae2e6408e6f6585e23f4f10ddeafdcb8cf42324 (diff) | |
download | lua-297512b34c2d16bb7827ef61bd7b14467bfa4ecf.tar.gz lua-297512b34c2d16bb7827ef61bd7b14467bfa4ecf.tar.bz2 lua-297512b34c2d16bb7827ef61bd7b14467bfa4ecf.zip |
avoid using 'lua_pushliteral' in a non-zero-terminated string
Diffstat (limited to 'lutf8lib.c')
-rw-r--r-- | lutf8lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lutf8lib.c,v 1.12 2014/10/15 14:31:10 roberto Exp roberto $ | 2 | ** $Id: lutf8lib.c,v 1.13 2014/11/02 19:19:04 roberto Exp roberto $ |
3 | ** Standard library for UTF-8 manipulation | 3 | ** Standard library for UTF-8 manipulation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -248,7 +248,7 @@ static struct luaL_Reg funcs[] = { | |||
248 | 248 | ||
249 | LUAMOD_API int luaopen_utf8 (lua_State *L) { | 249 | LUAMOD_API int luaopen_utf8 (lua_State *L) { |
250 | luaL_newlib(L, funcs); | 250 | luaL_newlib(L, funcs); |
251 | lua_pushliteral(L, UTF8PATT); | 251 | lua_pushlstring(L, UTF8PATT, sizeof(UTF8PATT)/sizeof(char) - 1); |
252 | lua_setfield(L, -2, "charpattern"); | 252 | lua_setfield(L, -2, "charpattern"); |
253 | return 1; | 253 | return 1; |
254 | } | 254 | } |