aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/filesystem
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-08 14:52:17 +0800
committerchai <chaifix@163.com>2018-09-08 14:52:17 +0800
commit7c3609b04eabc79db0c0b245a155fc3c5e875053 (patch)
tree9333f727863c8fed738bd16eaf6d9e2f0d4f53b5 /src/lua/modules/filesystem
parent1ccc798ca383fc941d624751293ed88e012900d1 (diff)
*update
Diffstat (limited to 'src/lua/modules/filesystem')
-rw-r--r--src/lua/modules/filesystem/filesystem.cpp7
1 files changed, 4 insertions, 3 deletions
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;
}