* JSON errors are now labelled with JSON and not XML

* Fixed: [Performance issue when parsing large JSON param](https://github.com/clicon/clixon/issues/266)
* Moved strlen() from for end condition
* Fixed debugging of xpath parser
This commit is contained in:
Olof hagsand 2021-09-20 20:30:56 +02:00
parent 3cd3f7987d
commit 392e6679c5
17 changed files with 166 additions and 89 deletions

View file

@ -113,6 +113,7 @@ yang_patch_xml2json_modified_cbuf(cxobj *x_simple_patch)
cbuf *cb = NULL;
char *json_simple_patch_tmp;
int brace_count = 0;
size_t len;
json_simple_patch = cbuf_new();
if (json_simple_patch == NULL)
@ -122,7 +123,8 @@ yang_patch_xml2json_modified_cbuf(cxobj *x_simple_patch)
// Insert a '[' after the first '{' to get the JSON to match what api_data_post/write() expect
json_simple_patch_tmp = cbuf_get(cb);
for (int l = 0; l < strlen(json_simple_patch_tmp); l++) {
len = strlen(json_simple_patch_tmp);
for (int l = 0; l < strlen(len); l++) {
char c = json_simple_patch_tmp[l];
if (c == '{') {
brace_count++;