]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
on dup, increment both
authorAlan T. DeKok <aland@freeradius.org>
Sat, 11 Jun 2022 22:11:39 +0000 (18:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 11 Jun 2022 22:11:39 +0000 (18:11 -0400)
src/lib/util/sbuff.c

index b590e567ab380154124d827e3d2a8a6d9bf0e856..bf4313250b3bc6530669b6f024fa62b1eca030ed 100644 (file)
@@ -616,9 +616,14 @@ fr_sbuff_term_t *fr_sbuff_terminals_amerge(TALLOC_CTX *ctx, fr_sbuff_term_t cons
                int8_t cmp;
 
                cmp = terminal_cmp(&a->elem[i], &b->elem[j]);
-               if (cmp <= 0) {
+               if (cmp == 0) {
+                       j++;
                        tmp[num++] = &a->elem[i++];
-               } else {
+
+               } else if (cmp < 0) {
+                       tmp[num++] = &a->elem[i++];
+
+               } else if (cmp > 0) {
                        tmp[num++] = &b->elem[j++];
                }