Explorar o código

Lua base64 decoding: Do not add terminating zero to Lua string

bel2125 %!s(int64=2) %!d(string=hai) anos
pai
achega
f0b9514c23
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/mod_lua.inl

+ 1 - 1
src/mod_lua.inl

@@ -1527,7 +1527,7 @@ lsp_base64_encode(lua_State *L)
 				                 (int)text_len,
 				                 dst,
 				                 &dst_len);
-				lua_pushlstring(L, dst, dst_len);
+				lua_pushstring(L, dst);
 				mg_free(dst);
 			} else {
 				return luaL_error(L, "out of memory in base64_encode() call");