From 33c77c8a092c87d729822cbda220715da677facc Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 23 Jun 2022 12:36:17 +0200 Subject: [PATCH] Cleanup, debug stmts, diff vars and obsolete compile options --- apps/backend/backend_get.c | 4 ++++ include/clixon_custom.h | 15 --------------- lib/src/clixon_file.c | 2 +- test/lib.sh | 4 +--- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/apps/backend/backend_get.c b/apps/backend/backend_get.c index b4874798..6b21605e 100644 --- a/apps/backend/backend_get.c +++ b/apps/backend/backend_get.c @@ -303,6 +303,10 @@ filter_xpath_again(clicon_handle h, int retval = -1; int i; + if (xret == NULL){ + clicon_err(OE_PLUGIN, EINVAL, "xret is NULL"); + goto done; + } /* If vectors are specified then mark the nodes found and * then filter out everything else, * otherwise return complete tree. diff --git a/include/clixon_custom.h b/include/clixon_custom.h index b905ad93..1f08ea06 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -164,19 +164,4 @@ */ #define PROTO_RESTART_RECONNECT -/*! Text output keys as identifiers instead of ordinary leafs - * That is, given list "list" with key value "a", if set, the output of show config or save - * as text command is: - * list a { - * val 42; - * } - * If not set, the output is: - * list { - * keyname a; - * val 42; - * } - * The TEXT parser (ie load) accepts both formats. - */ -#define TEXT_LIST_KEYS - diff --git a/lib/src/clixon_file.c b/lib/src/clixon_file.c index aecc9d77..9391e74d 100644 --- a/lib/src/clixon_file.c +++ b/lib/src/clixon_file.c @@ -238,7 +238,7 @@ clicon_file_dirent(const char *dir, clicon_err(OE_UNIX, errno, "realloc"); goto quit; } /* realloc */ - clicon_debug(1, "%s memcpy(%p %p %u", __FUNCTION__, &new[nent], dent, direntStructSize); + clicon_debug(2, "%s memcpy(%p %p %u", __FUNCTION__, &new[nent], dent, direntStructSize); /* man (3) readdir: * By implication, the use sizeof(struct dirent) to capture the size of the record including * the size of d_name is also incorrect. */ diff --git a/test/lib.sh b/test/lib.sh index 7014f624..5008d1c0 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -351,9 +351,7 @@ function err(){ fi echo -e "\e[0m" echo "Diff between Expected and Received:" - echo "$ret"| od -t c > $dir/clixon-ret - echo "$expect"| od -t c > $dir/clixon-expect - diff $dir/clixon-expect $dir/clixon-ret + diff <(echo "$ret"| od -t c) <(echo "$expect"| od -t c) exit -1 #$testnr }