From 7c3609b04eabc79db0c0b245a155fc3c5e875053 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 8 Sep 2018 14:52:17 +0800 Subject: *update --- src/lua/modules/filesystem/filesystem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lua/modules/filesystem/filesystem.cpp') diff --git a/src/lua/modules/filesystem/filesystem.cpp b/src/lua/modules/filesystem/filesystem.cpp index f377f0c..1fc0d7c 100644 --- a/src/lua/modules/filesystem/filesystem.cpp +++ b/src/lua/modules/filesystem/filesystem.cpp @@ -112,9 +112,10 @@ namespace lua Filesystem* fs = context.fs; const char* file = luax_checkstring(L, 1); unsigned int len; - char* data = (char*)fs->read(file, &len); - luax_pushstring(L, data); - luax_pushinteger(L, len); + Buffer buffer; + buffer.data = (char*)fs->read(file, &buffer.size); + luax_pushstring(L, (char*)buffer.data); + luax_pushinteger(L, buffer.size); return 2; } -- cgit v1.1-26-g67d0