Remove warnings from lcl.c and lfile.c by fixing some issues
This commit is contained in:
parent
f2ff542bcb
commit
612a22678b
2 changed files with 7 additions and 7 deletions
8
lfile.c
8
lfile.c
|
@ -38,10 +38,10 @@
|
|||
static int
|
||||
file_basename(lua_State *L)
|
||||
{
|
||||
const char *path; /* parameter 1 (string) */
|
||||
const char *ret;
|
||||
char *path; /* parameter 1 (string) */
|
||||
|
||||
path = luaL_checkstring(L, 1);
|
||||
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
||||
ret = basename(path);
|
||||
|
||||
if (ret == NULL && errno == ENAMETOOLONG) /* check if path is too long */
|
||||
|
@ -70,10 +70,10 @@ file_basename(lua_State *L)
|
|||
static int
|
||||
file_dirname(lua_State *L)
|
||||
{
|
||||
const char *path; /* parameter 1 (string) */
|
||||
const char *ret;
|
||||
char *path; /* parameter 1 (string) */
|
||||
|
||||
path = luaL_checkstring(L, 1);
|
||||
path = strndup(luaL_checkstring(L, 1), lua_rawlen(L, 1));
|
||||
ret = dirname(path);
|
||||
|
||||
if (ret == NULL && errno == ENAMETOOLONG) /* check if path is too long */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue