diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec088f8d..fa39db4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ In some cases, Clixon uses three-value returns as follows: - `0` Invalid - `-1` Fatal error -### Return values +### Return values and goto:s Clixon uses goto:s only to get a single point of exit functions as follows: ``` @@ -80,7 +80,7 @@ Clixon uses goto:s only to get a single point of exit functions as follows: Notes: 1. Use only a single return statement in a function -2. Do not use of goto:s in other ways +2. Do not use goto:s in other ways ### Comments diff --git a/apps/cli/cli_common.c b/apps/cli/cli_common.c index caf68e5a..8fda05e9 100644 --- a/apps/cli/cli_common.c +++ b/apps/cli/cli_common.c @@ -402,7 +402,7 @@ cli_dbxml(clicon_handle h, clicon_err(OE_UNIX, errno, "cbuf_new"); goto done; } - /* Concatenate all argv strings to a sinle string */ + /* Concatenate all argv strings to a single string */ if (cvec_concat_cb(argv, api_path_fmt_cb) < 0) goto done; api_path_fmt = cbuf_get(api_path_fmt_cb); @@ -1670,7 +1670,9 @@ cvec_concat_cb(cvec *cvv, } /* Append a api_path_fmt from sub-parts */ for (i=argc-1; i>=0; i--){ - cprintf(cb, "%s", cv_string_get(cvec_i(cvv, i))); + cv = cvec_i(cvv, i); + str = cv_string_get(cv); + cprintf(cb, "%s", str); } retval = 0; done: diff --git a/apps/cli/cli_common.h b/apps/cli/cli_common.h index b60f3cb8..05e05080 100644 --- a/apps/cli/cli_common.h +++ b/apps/cli/cli_common.h @@ -43,7 +43,6 @@ void cli_signal_block(clicon_handle h); void cli_signal_unblock(clicon_handle h); int mtpoint_paths(yang_stmt *yspec0, char *mtpoint, char *api_path_fmt1, char **api_path_fmt01); cvec *cvec_append(cvec *cvv0, cvec *cvv1); -int cvec_concat_cb(cvec *cvv, cbuf *cb); /* If you do not find a function here it may be in clixon_cli_api.h which is the external API */ diff --git a/apps/cli/clixon_cli_api.h b/apps/cli/clixon_cli_api.h index d650a67e..c5886ba8 100644 --- a/apps/cli/clixon_cli_api.h +++ b/apps/cli/clixon_cli_api.h @@ -111,6 +111,7 @@ int cli_unlock(clicon_handle h, cvec *cvv, cvec *argv); int cli_copy_config(clicon_handle h, cvec *cvv, cvec *argv); int cli_help(clicon_handle h, cvec *vars, cvec *argv); cvec *cvec_append(cvec *cvv0, cvec *cvv1); +int cvec_concat_cb(cvec *cvv, cbuf *cb); int cli_process_control(clicon_handle h, cvec *vars, cvec *argv); /* In cli_show.c */ diff --git a/doc/DEVELOP.md b/doc/DEVELOP.md index e097024c..a3497b26 100644 --- a/doc/DEVELOP.md +++ b/doc/DEVELOP.md @@ -163,7 +163,7 @@ What to think about when doing a new release. * Ensure all extended tests run OK: valgrind, vagrant, afl * Review CHANGELOG, write one-liner * Draft a new release and review generated release notes and use info to update CHANGELOG -* Review README.md wording about latest release +* Review README.md * New yang/clicon/clixon-config@XXX.yang revision? * In configure.ac, for minor releases change CLIXON_VERSION in configure.ac to eg: (minor should have been bumped): ``` diff --git a/example/main/example_backend.c b/example/main/example_backend.c index 9253dea8..d8cfa3ed 100644 --- a/example/main/example_backend.c +++ b/example/main/example_backend.c @@ -1369,6 +1369,8 @@ example_daemon(clicon_handle h) } retval = 0; done: + if (xerr) + xml_free(xerr); if (fp) fclose(fp); return retval; diff --git a/lib/src/clixon_xml_io.c b/lib/src/clixon_xml_io.c index 6756327e..04e52237 100644 --- a/lib/src/clixon_xml_io.c +++ b/lib/src/clixon_xml_io.c @@ -554,6 +554,7 @@ xmltree2cbuf(cbuf *cb, * Therefore checking for empty XML must be done by a calling function which knows wether the * the XML represents a full document or not. * @note may be called recursively, some yang-bind (eg rpc) semantic checks may trigger error message + * @note yang-binding over schema mount-points do not work, you need to make a separate bind call */ static int _xml_parse(const char *str,