Ticket #43539: patch-common-llist.c.diff

File patch-common-llist.c.diff, 793 bytes (added by macports@…, 10 years ago)
  • common/llist.c

    old new  
    281281{
    282282        LNode *entry;
    283283
    284         if (index < 0 || index >= list->size)
     284        if (index >= list->size)
    285285                return NULL;
    286286
    287287        entry = llist_get_entry(list, index);
     
    294294        LNode *entry;
    295295        void *old_data;
    296296
    297         if (index < 0 || index >= list->size)
     297        if (index >= list->size)
    298298                return NULL;
    299299
    300300        entry = llist_get_entry(list, index);
     
    316316{
    317317        LNode *entry;
    318318       
    319         if (index < 0 || index > list->size)
     319        if (index > list->size)
    320320                return;
    321321
    322322        entry = xmalloc(sizeof(LNode));
     
    343343        LNode *entry;
    344344        void *data;
    345345
    346         if (index < 0 || index >= list->size)
     346        if (index >= list->size)
    347347                return NULL;
    348348
    349349        entry = llist_get_entry(list, index);