srdja / Collections-C

A library of generic data structures for the C language.
http://srdja.github.io/Collections-C
GNU Lesser General Public License v3.0
2.8k stars 328 forks source link

cc_list.c (index > list1->size)maybe is wrong #163

Closed FXD-jl closed 1 year ago

FXD-jl commented 1 year ago

enum cc_stat cc_list_add_all_at(CC_List list1, CC_List list2, size_t index) { if (list2->size == 0) return CC_OK;

if (index > list1->size)
    return CC_ERR_OUT_OF_RANGE;

.... } index >= list1->size : I think is right,because index is like array's index