Removed all exit calls

This commit is contained in:
Maciej Samborski 2024-09-23 19:07:53 +02:00
parent b2d67cca8d
commit b2f4a4b8e4
1 changed files with 4 additions and 7 deletions

11
ll.h
View File

@ -118,9 +118,8 @@ llList * _llInsert(llList * list, size_t id, void * value)
{
if (node->next == NULL && id > 1)
{
fprintf(stderr, "RUNTIME ERROR: Index out of bounds\n");
llFree(list);
exit(1);
fprintf(stderr, "ERROR: Index out of bounds\n");
return list;
}
prev = node;
@ -154,8 +153,7 @@ llList * _llDelete(llList * list, size_t id)
if (node->next == NULL)
{
fprintf(stderr, "RUNTIME ERROR: Index out of bounds\n");
llFree(list);
exit(1);
return list;
}
prev = node;
@ -199,8 +197,7 @@ void * _llGetRef(llList * list, size_t id)
if (node->next == NULL)
{
fprintf(stderr, "RUNTIME ERROR: Index out of bounds\n");
llFree(list);
exit(1);
return NULL;
}
node = node->next;