From 01de2a9bd5c4689b70c7cf237b718135c5c73d7b Mon Sep 17 00:00:00 2001 From: Sai Ke WANG Date: Wed, 25 Dec 2019 13:01:43 -0500 Subject: lua: fix mp.file_info for large files `size` field with `unsigned int` was truncated to 4GB Signed-off-by: wm4 --- player/lua.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/lua.c b/player/lua.c index aec9908b69..cee4c118ad 100644 --- a/player/lua.c +++ b/player/lua.c @@ -1131,7 +1131,7 @@ static int script_file_info(lua_State *L) "mode", "size", "atime", "mtime", "ctime", NULL }; - const unsigned int stat_values[] = { + const lua_Number stat_values[] = { statbuf.st_mode, statbuf.st_size, statbuf.st_atime, @@ -1141,7 +1141,7 @@ static int script_file_info(lua_State *L) // Add all fields for (int i = 0; stat_names[i]; i++) { - lua_pushinteger(L, stat_values[i]); + lua_pushnumber(L, stat_values[i]); lua_setfield(L, -2, stat_names[i]); } -- cgit v1.2.3