* 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

@ -1210,6 +1210,7 @@ cli_copy_config(clicon_handle h,
char *toname;
cxobj *xerr;
cvec *nsc = NULL;
size_t len;
if (cvec_len(argv) != 6){
clicon_err(OE_PLUGIN, EINVAL, "Requires 6 elements: <db> <xpath> <namespace> <keyname> <from> <to>");
@ -1241,8 +1242,9 @@ cli_copy_config(clicon_handle h,
goto done;
}
/* Sanity check that xpath contains exactly two %s, ie [%s='%s'] */
len = strlen(xpath);
j = 0;
for (i=0; i<strlen(xpath); i++){
for (i=0; i<len; i++){
if (xpath[i] == '%')
j++;
}