From: Alan T. DeKok Date: Mon, 2 Nov 2020 14:10:17 +0000 (-0500) Subject: use merge to merge lists of cursors X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb55ebd3a9aab4803cb046b7933f2e2ca677ed01;p=thirdparty%2Ffreeradius-server.git use merge to merge lists of cursors --- diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index c1960bf89d9..04e138d71a7 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -611,6 +611,8 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_t ** fr_cursor_init(&cursor, out); while (fgets(buf, sizeof(buf), fp) != NULL) { + fr_cursor_t append; + /* * If we get a '\n' by itself, we assume that's * the end of that VP list. @@ -638,7 +640,8 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_t ** break; } - fr_cursor_append(&cursor, vp); + fr_cursor_init(&append, &vp); + fr_cursor_merge(&cursor, &append); (void) fr_cursor_tail(&cursor); buf[0] = '\0';