lua: fix mp.file_info for large files

`size` field with `unsigned int` was truncated to 4GB

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
Sai Ke WANG authored and wm4 committed 2019-12-28 14:34:32 +01:00
1 parent 13b8363c47
commit 01de2a9bd5
1 file changed
+2 -2
+2 -2
View File
@@ -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]);
}