aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/graphics.cpp
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/graphics/graphics.cpp
parent1ccc798ca383fc941d624751293ed88e012900d1 (diff)
*update
Diffstat (limited to 'src/lua/modules/graphics/graphics.cpp')
-rw-r--r--src/lua/modules/graphics/graphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp
index ada4754..4d597ae 100644
--- a/src/lua/modules/graphics/graphics.cpp
+++ b/src/lua/modules/graphics/graphics.cpp
@@ -110,7 +110,7 @@ namespace lua
error(L, "No such image file %s", f);
goto fail;
}
- Buffer b;
+ Buffer b = {};
if (!fs->read(f, &b))
{
error(L, "Failed to read image %s", f);
@@ -459,13 +459,13 @@ namespace lua
{
const char* path = luax_checkstring(L, 1);
Filesystem* fs = Filesystem::get();
- Buffer b = {};
if (!fs->exists(path))
{
error(L, "No such font %s\n", path);
luax_pushnil(L);
return 1;
}
+ Buffer b = {};
fs->read(path, &b);
font->loadMemory((const unsigned char*)b.data);
}