diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2019-06-06 19:13:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-06 19:13:29 +0200 |
commit | cb00632e23a41d8d171631de9d85e168b251b80e (patch) | |
tree | 684787f3056df0d5ab7b0e1cb504c2b6866ae334 /src/script/common/helper.cpp | |
parent | 7379aa74cf98c7e4c7aa5325ef1531d412a0abac (diff) | |
download | minetest-cb00632e23a41d8d171631de9d85e168b251b80e.tar.gz minetest-cb00632e23a41d8d171631de9d85e168b251b80e.tar.bz2 minetest-cb00632e23a41d8d171631de9d85e168b251b80e.zip |
HTTP API: Allow binary downloads and headers (#8573)
Add minetest.features.httpfetch_binary_data
Diffstat (limited to 'src/script/common/helper.cpp')
-rw-r--r-- | src/script/common/helper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/common/helper.cpp b/src/script/common/helper.cpp index 59bde57ab..f53a2b7e8 100644 --- a/src/script/common/helper.cpp +++ b/src/script/common/helper.cpp @@ -107,9 +107,10 @@ template <> v2f LuaHelper::readParam(lua_State *L, int index) template <> std::string LuaHelper::readParam(lua_State *L, int index) { + size_t length; std::string result; - const char *str = luaL_checkstring(L, index); - result.append(str); + const char *str = luaL_checklstring(L, index, &length); + result.assign(str, length); return result; } |