diff --git a/klient/strategy.cpp b/klient/strategy.cpp index d793763..b4298b5 100644 --- a/klient/strategy.cpp +++ b/klient/strategy.cpp @@ -101,11 +101,11 @@ struct State // Ano, vím, že je to ošklivé, ale prostě parsovat JSON v C/C++ je za trest int r; jsmn_parser p; - jsmntok_t t[10000]; /* We expect no more than this count of tokens (jsmn limitation)*/ + t_len = 100000000; + jsmntok_t * t = new jsmntok_t[t_len]; /* We expect no more than this count of tokens (jsmn limitation)*/ jsmn_init(&p); - r = jsmn_parse(&p, input_str, strlen(input_str), t, - sizeof(t) / sizeof(t[0])); + r = jsmn_parse(&p, input_str, strlen(input_str), t, t_len); assert(!(r < 0)); assert(!(r < 1 || t[0].type != JSMN_OBJECT));