Skip to content

bugfix #9

Description

@basetutu

sglib/sglib.h

Line 554 in 1d17ed7

if ((elem)->previous != NULL) (elem)->previous->next = (elem);\

Hi!
Would like to suggest a change. (bugfix)
After the indicated line above, there should be the line:
(place) = (elem)\

This allows consecutive use of sglib_type_add_before(dllist_first), in the corner case where the dllist_first is NULL to begin with.

Current solution results in keeping the dllist_first pointer value the same as first call and place all new entries behind this first one which is continuously is moving further away from the 'front'.

Hence, new entries are placed at length-2 position!

This change fixed it. I can also push the change for review, if you like.
I am only working with the doubly ended linked list.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions