diff --git a/apps/backend/clixon_backend_plugin.h b/apps/backend/clixon_backend_plugin.h index 4bbff766..af0e95c0 100644 --- a/apps/backend/clixon_backend_plugin.h +++ b/apps/backend/clixon_backend_plugin.h @@ -51,7 +51,7 @@ * It is up to the validate callbacks to ensure that these changes are OK * It is up to the commit callbacks to enforce these changes in the "state" of * the system. - * see also transaction_data in clixon_plugin.h + * @see transaction_data in clixon_plugin.h */ typedef struct { uint64_t td_id; /* Transaction id */ diff --git a/example/main/example_backend.c b/example/main/example_backend.c index 62ca4d1d..2202cfda 100644 --- a/example/main/example_backend.c +++ b/example/main/example_backend.c @@ -428,7 +428,7 @@ example_statedata(clicon_handle h, int retval = -1; cxobj **xvec = NULL; size_t xlen = 0; - cbuf *cb = cbuf_new(); + cbuf *cb = NULL; int i; cxobj *xt = NULL; char *name; @@ -437,6 +437,10 @@ example_statedata(clicon_handle h, if (!_state) goto ok; + if ((cb = cbuf_new()) == NULL){ + clicon_err(OE_UNIX, errno, "cbuf_new"); + goto done; + } yspec = clicon_dbspec_yang(h); /* Example of statedata, in this case merging state data with * state information. In this case adding dummy interface operation state @@ -1055,7 +1059,13 @@ upgrade_2016_to_2018(clicon_handle h, if ((x = xpath_first(xi, NULL, "statistics/in-octets")) != NULL){ if ((xb = xml_body_get(x)) != NULL){ uint64_t u64; - cbuf *cb = cbuf_new(); + cbuf *cb; + + if ((cb = cbuf_new()) == NULL){ + clicon_err(OE_UNIX, errno, "cbuf_new"); + goto done; + } + parse_uint64(xml_value(xb), &u64, NULL); cprintf(cb, "%" PRIu64 ".%03d", u64/1000, (int)(u64%1000)); xml_value_set(xb, cbuf_get(cb)); diff --git a/lib/clixon/clixon_plugin.h b/lib/clixon/clixon_plugin.h index 7037fc34..6583244d 100644 --- a/lib/clixon/clixon_plugin.h +++ b/lib/clixon/clixon_plugin.h @@ -241,7 +241,7 @@ typedef void *pagination_data; typedef int (plglockdb_t)(clicon_handle h, char *db, int lock, int id); /* Transaction-data type - * @see clixon_backend_transaction.h for full transaction API + * @see transaction_data_t and clixon_backend_transaction.h for full transaction API */ typedef void *transaction_data; diff --git a/lib/src/clixon_client.c b/lib/src/clixon_client.c index ac84f6c1..c71445bc 100644 --- a/lib/src/clixon_client.c +++ b/lib/src/clixon_client.c @@ -452,7 +452,6 @@ clixon_xml_bottom(cxobj *xtop, return retval; } - /*! Internal function to construct a get-config and query a value from the backend * * @param[in] sock Socket diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index cfeae292..cc3056f2 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -900,7 +900,7 @@ text_modify(clicon_handle h, * As an alternative, return in populate where this is detected first time. */ if (yc != xml_spec(x1c)){ - clicon_err(OE_YANG, errno, "XML node %s not in namespace %s", + clicon_err(OE_YANG, errno, "XML node \"%s\" not in namespace %s", x1cname, yang_find_mynamespace(y0)); goto done; } @@ -1146,7 +1146,7 @@ text_modify_top(clicon_handle h, * @param[in] h CLICON handle * @param[in] db running or candidate * @param[in] op Top-level operation, can be superceded by other op in tree - * @param[in] xt xml-tree. Top-level symbol is dummy + * @param[in] x1 xml-tree. Top-level symbol is dummy * @param[in] username User name for nacm * @param[out] cbret Initialized cligen buffer. On exit contains XML if retval == 0 * @retval 1 OK