- for (ed = ptr_expectdomain, i = 0, d = 1;
- i < PTR_NDOMAIN;
- ed++, i++, d <<= 1) {
- if (!(f & d)) continue;
- if (labnum < ed->ai->nrevcomp) {
- ac = ed->ai->rev_parsecomp(label, lablen);
- if (ac < 0) goto mismatch;
- assert(labnum < sizeof(css->ptr.ipv[i]));
- css->ptr.ipv[i][labnum] = ac;
- } else {
- tp = ed->tail[labnum - ed->ai->nrevcomp];
- if (!tp || strncmp(label, tp, lablen) != 0 || tp[lablen])
- goto mismatch;
- }
- continue;
-
- mismatch:
- f &= ~d;
- if (!f) return adns_s_querydomainwrong;
- }
+ if (adns__revparse_label(&css->ptr, labnum, label,lablen))
+ return adns_s_querydomainwrong;