diff options
author | Simon Rettberg | 2015-02-25 17:51:20 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-25 17:51:20 +0100 |
commit | 7cdfbd5a67ea556956c04a4e52df0f08520c86ac (patch) | |
tree | fd45bff6b672d0a3ab7a708d168dab6ba51bc3f2 | |
parent | Fix epoll based detection of closed connections (diff) | |
download | ldadp-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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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: |