use strerror_r over strerror when lfail is called
This commit is contained in:
parent
dfe3e57d1c
commit
03b3631fa9
1 changed files with 4 additions and 1 deletions
5
util.c
5
util.c
|
@ -15,8 +15,11 @@
|
||||||
int
|
int
|
||||||
lfail(lua_State *L)
|
lfail(lua_State *L)
|
||||||
{
|
{
|
||||||
|
char strerrbuf[256];
|
||||||
|
|
||||||
luaL_pushfail(L);
|
luaL_pushfail(L);
|
||||||
lua_pushstring(L, strerror(errno));
|
strerror_r(errno, strerrbuf, 256);
|
||||||
|
lua_pushstring(L, strerrbuf);
|
||||||
lua_pushinteger(L, errno);
|
lua_pushinteger(L, errno);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue