summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
index c4598e41aae..eed623dfad8 100644
--- a/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
+++ b/Build/source/texk/web2c/luatexdir/luafilesystem/src/lfs.c
@@ -114,15 +114,14 @@ static int change_dir (lua_State *L) {
** and a string describing the error
*/
static int get_dir (lua_State *L) {
- char *path;
- if ((path = getcwd(NULL, 0)) == NULL) {
+ char path[500];
+ if (getcwd((char *)path, 500) == NULL) {
lua_pushnil(L);
lua_pushstring(L, getcwd_error);
return 2;
}
else {
lua_pushstring(L, path);
- free(path);
return 1;
}
}