it's rather surprising to see fr_cursor_append() set vp->next=NULL
which causes all kinds of issues with callers expecting something
else.
char buf[8192];
FR_TOKEN last_token = T_EOL;
- fr_cursor_t cursor;
+ fr_cursor_t cursor, to_append;
VALUE_PAIR *vp = NULL;
fr_cursor_init(&cursor, out);
break;
}
- do {
- fr_cursor_append(&cursor, vp);
- } while (vp->next && (vp = vp->next));
+ fr_cursor_init(&to_append, &vp);
+ fr_cursor_merge(&cursor, &to_append);
buf[0] = '\0';
}