typo in rearrange includes; unused reason parameter in snmp_lib

This commit is contained in:
Olof hagsand 2023-03-03 17:41:02 +01:00
parent 1f5df800bc
commit 995c3b2c67
2 changed files with 10 additions and 4 deletions

View file

@ -158,7 +158,7 @@ uninstall:
rm -f $(DESTDIR)$(libdir)/$(MYLIBDYNAMIC) rm -f $(DESTDIR)$(libdir)/$(MYLIBDYNAMIC)
rm -f $(DESTDIR)$(includedir)/clixon/* rm -f $(DESTDIR)$(includedir)/clixon/*
install-include: clixon_backend.h clixon_backend_handle.h clixon_backend_transaction.h clixon_backend_plugin.h clixon_backend_commit.h install-include: clixon_backend.h clixon_backend_client.h clixon_backend_transaction.h clixon_backend_plugin.h clixon_backend_commit.h
install -d -m 0755 $(DESTDIR)$(includedir)/clixon install -d -m 0755 $(DESTDIR)$(includedir)/clixon
install -m 0644 $^ $(DESTDIR)$(includedir)/clixon install -m 0644 $^ $(DESTDIR)$(includedir)/clixon

View file

@ -725,6 +725,7 @@ type_xml2snmp_pre(char *xmlstr0,
char *restype = NULL; /* resolved type */ char *restype = NULL; /* resolved type */
char *str = NULL; char *str = NULL;
int ret; int ret;
cbuf *cb = NULL;
if (xmlstr0 == NULL || xmlstr1 == NULL){ if (xmlstr0 == NULL || xmlstr1 == NULL){
clicon_err(OE_UNIX, EINVAL, "xmlstr0/1 is NULL"); clicon_err(OE_UNIX, EINVAL, "xmlstr0/1 is NULL");
@ -753,11 +754,14 @@ type_xml2snmp_pre(char *xmlstr0,
str = "1"; str = "1";
} }
else if( strcmp(restype, "decimal64") == 0 ) { else if( strcmp(restype, "decimal64") == 0 ) {
char **reason;
cbuf *cb = cbuf_new();
cg_var* cv = yang_cv_get(ys); cg_var* cv = yang_cv_get(ys);
int64_t num; int64_t num;
if( (ret = parse_dec64(xmlstr0, cv_dec64_n_get(cv), &num, reason)) < 0)
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
if ((ret = parse_dec64(xmlstr0, cv_dec64_n_get(cv), &num, NULL)) < 0)
goto done; goto done;
if (ret == 0){ if (ret == 0){
clicon_debug(1, "Invalid decimal64 valstr %s", xmlstr0); clicon_debug(1, "Invalid decimal64 valstr %s", xmlstr0);
@ -777,6 +781,8 @@ type_xml2snmp_pre(char *xmlstr0,
retval = 1; retval = 1;
done: done:
clicon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval); clicon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
if (cb)
cbuf_free(cb);
return retval; return retval;
fail: fail:
retval = 0; retval = 0;