From f6a9bdf4f59c2bb9c053e036aebd8fcc21f68065 Mon Sep 17 00:00:00 2001 From: Hammy Date: Thu, 6 Jan 2022 18:07:50 +0000 Subject: [PATCH] Add new error code --- src/list.c | 7 ++++--- src/list.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/list.c b/src/list.c index bbbf501..ada9fa2 100644 --- a/src/list.c +++ b/src/list.c @@ -2,7 +2,7 @@ #include "stdarg.h" #define DEFAULT_MAX_SIZE 10 -#define ERRNO_SIZE 5 +#define ERRNO_SIZE 6 List *List_createList(int maxSize, int currentSize); @@ -21,7 +21,8 @@ int errorCodes[ERRNO_SIZE] = { ERRNO_002, ERRNO_003, ERRNO_004, - ERRNO_005 + ERRNO_005, + ERRNO_006 }; List *List_new() { @@ -221,7 +222,7 @@ int List_extend(List *list_to_extend, List *input_list) { int List_count(List *list, int element) { if (!list) { - return 1; + return ERRNO_006; } int count = 0; diff --git a/src/list.h b/src/list.h index dd94bd4..031b8b0 100644 --- a/src/list.h +++ b/src/list.h @@ -12,6 +12,8 @@ #define ERRNO_004 2147483643 // [ERRNO 2147483642] -> Element Does Not Exist Within List #define ERRNO_005 2147483642 +// [ERRNO 2147483641] -> Null List +#define ERRNO_006 2147483641 typedef struct list List;