return offset;
}
- do {
- vp = fr_dcursor_next(cursor);
- if (!vp || !vp->da->flags.internal) break;
- } while (vp != NULL);
+ vp = fr_dcursor_next(cursor);
+ if (!vp) break;
+
goto next;
}
raw:
if (fr_value_box_to_network(&work_dbuff, &vp->data) <= 0) return PAIR_ENCODE_FATAL_ERROR;
- do {
- vp = fr_dcursor_next(cursor);
- if (!vp || !vp->da->flags.internal) break;
- } while (vp != NULL);
+ vp = fr_dcursor_next(cursor);
+ if (!vp) break;
if (child->flags.array && (vp->da == child)) goto redo;
}
done:
vp = fr_dcursor_current(cursor);
- if (tlv) {
+ if (tlv && vp) {
ssize_t slen;
if (!encode_cursor) {
return PAIR_ENCODE_FATAL_ERROR;
}
- fr_proto_da_stack_build(da_stack, vp ? vp->da : NULL);
+ fr_proto_da_stack_build(da_stack, vp->da);
/*
* Encode any TLV attributes which are part of this structure.
if (slen < 0) return slen;
vp = fr_dcursor_current(cursor);
- fr_proto_da_stack_build(da_stack, vp ? vp->da : NULL);
+ if (!vp) break;
+
+ fr_proto_da_stack_build(da_stack, vp->da);
}
}