Fix for cli expansion of two variables

This commit is contained in:
Olof hagsand 2018-01-25 22:16:44 +01:00
parent 6c7554de25
commit 99abac76a7

View file

@ -889,7 +889,7 @@ api_path_fmt2api_path(char *api_path_fmt,
char *strenc=NULL;
cg_var *cv;
#if 1
#if 0 /* XXX Does not work in expansion case */
/* Sanity check */
j = 0; /* Count % */
for (i=0; i<strlen(api_path_fmt); i++)
@ -981,7 +981,7 @@ api_path_fmt2xpath(char *api_path_fmt,
cg_var *cv;
/* Sanity check: count '%' */
#if 1
#if 0 /* XXX Does not work in expansion case */
j = 0; /* Count % */
for (i=0; i<strlen(api_path_fmt); i++)
if (api_path_fmt[i] == '%')
@ -1578,7 +1578,7 @@ api_path2xml_vec(char **vec,
else{
if ((valvec = clicon_strsep(restval, ",", &nvalvec)) == NULL)
goto done;
if (cvec_len(cvk) != nvalvec){
if (nvalvec > cvec_len(cvk)){
clicon_err(OE_XML, errno, "List %s key length mismatch", name);
goto done;
}