From d5242f5ba9c027794d61dd9997f24e2d43f5ac39 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda Date: Fri, 23 Sep 2022 12:53:07 +0200 Subject: [PATCH] =?UTF-8?q?Strategick=C3=A1:=20C:=20lep=C5=A1=C3=AD=20alok?= =?UTF-8?q?ace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klient/strategy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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));