mirror of
https://github.com/lxsang/silk.git
synced 2024-12-26 04:48:21 +01:00
fix: support decode big file
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
This commit is contained in:
parent
34c2d3ae4e
commit
a6838e5294
@ -1,7 +1,8 @@
|
||||
#include "lua/lualib.h"
|
||||
#include "3rd/jsmn/jsmn.h"
|
||||
|
||||
#define MAXTOKEN 8192
|
||||
// support upto 65536 tokens which is around of 1MB memory
|
||||
#define MAXTOKEN 65536
|
||||
|
||||
// define unescape sequence
|
||||
|
||||
@ -246,7 +247,8 @@ static int l_json_parser(lua_State *L, const char* s)
|
||||
int r = jsmn_parse(&p, s, strlen(s), t, sizeof(t)/sizeof(t[0]));
|
||||
if (r < 0) {
|
||||
lua_pushnil(L);
|
||||
return 0;
|
||||
lua_pushnumber(L,r);
|
||||
return 2;
|
||||
}
|
||||
token_to_object(L,t,s,0);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user