client BUGFIX filter in rpcs can be "" according to the RFC
diff --git a/src/session_client.c b/src/session_client.c
index 7f950b2..cd49325 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -1255,7 +1255,7 @@
return NC_MSG_ERROR;
}
if (rpc_gc->filter) {
- if (rpc_gc->filter[0] == '<') {
+ if (!rpc_gc->filter[0] || (rpc_gc->filter[0] == '<')) {
node = lyd_new_anyxml(data, ietfnc, "filter", rpc_gc->filter);
lyd_insert_attr(node, "type", "subtree");
} else {
@@ -1454,7 +1454,7 @@
data = lyd_new(NULL, ietfnc, "get");
if (rpc_g->filter) {
- if (rpc_g->filter[0] == '<') {
+ if (!rpc_g->filter[0] || (rpc_g->filter[0] == '<')) {
node = lyd_new_anyxml(data, ietfnc, "filter", rpc_g->filter);
lyd_insert_attr(node, "type", "subtree");
} else {
@@ -1625,7 +1625,7 @@
}
if (rpc_sub->filter) {
- if (rpc_sub->filter[0] == '<') {
+ if (!rpc_sub->filter[0] || (rpc_sub->filter[0] == '<')) {
node = lyd_new_anyxml(data, notifs, "filter", rpc_sub->filter);
lyd_insert_attr(node, "type", "subtree");
} else {