summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-02-25 17:51:20 +0100
committerSimon Rettberg2015-02-25 17:51:20 +0100
commit7cdfbd5a67ea556956c04a4e52df0f08520c86ac (patch)
treefd45bff6b672d0a3ab7a708d168dab6ba51bc3f2
parentFix epoll based detection of closed connections (diff)
downloadldadp-7cdfbd5a67ea556956c04a4e52df0f08520c86ac.tar.gz
ldadp-7cdfbd5a67ea556956c04a4e52df0f08520c86ac.tar.xz
ldadp-7cdfbd5a67ea556956c04a4e52df0f08520c86ac.zip
Fix formatting bug in print filter function; skip NULL filters (which would be an invalid filter anyways...)
-rw-r--r--helper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/helper.c b/helper.c
index 8dec6e4..c938783 100644
--- a/helper.c
+++ b/helper.c
@@ -88,6 +88,8 @@ static void helper_printavaInt(struct AttributeValueAssertion* a,const char* rel
printf("[%.*s %s", (int)a->desc.l, a->desc.s, rel);
if (a->value.l != 0 && a->value.s != NULL) {
printf(" %.*s]", (int)a->value.l,a->value.s);
+ } else {
+ putchar(']');
}
}
@@ -111,17 +113,20 @@ void helper_printal(struct AttributeDescriptionList* a)
static void helper_printfilterInt(struct Filter* f)
{
+ if (f == NULL) {
+ printf("(nullfilter)");
+ return;
+ }
switch (f->type) {
case AND:
printf("&(");
mergesub:
helper_printfilterInt(f->x);
- printf(")");
+ putchar(')');
break;
case OR:
printf("|(");
goto mergesub;
- break;
case NOT:
printf("!(");
goto mergesub;
@@ -162,6 +167,7 @@ mergesub:
helper_printavaInt(&f->ava,"<=");
break;
case PRESENT:
+ f->ava.value.l = 0;
helper_printavaInt(&f->ava,"\\exist");
break;
case APPROX: