]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Typo in cursor_replace
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 14 Sep 2017 12:22:40 +0000 (19:22 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 14 Sep 2017 12:23:32 +0000 (19:23 +0700)
src/lib/util/cursor.c

index 02b69ab829d06315808195cfba9e73216a53b8fb..1eec051b3e57e74f9034f9b7e14c9443665a07b9 100644 (file)
@@ -458,7 +458,7 @@ void * CC_HINT(hot) fr_cursor_replace(fr_cursor_t *cursor, void *r)
         *      so the replace becomes an append.
         */
        v = cursor->current;
-       if (v) {
+       if (!v) {
                fr_cursor_append(cursor, r);
                return NULL;
        }
@@ -475,9 +475,9 @@ void * CC_HINT(hot) fr_cursor_replace(fr_cursor_t *cursor, void *r)
                *NEXT_PTR(r) = *NEXT_PTR(v);
        }
 
-        /*
-         *     Fixup current pointer.
-         */
+       /*
+             Fixup current pointer.
+        */
        if (v) {
                cursor->current = p;
                cursor->prev = NULL;                            /* populated on next call to fr_cursor_next */