diff --git a/CLI/CLI.c b/CLI/CLI.c index 0f09a60..66644ca 100644 --- a/CLI/CLI.c +++ b/CLI/CLI.c @@ -6,6 +6,7 @@ #include // #include +#define HISTORY #include "../FIFOBuff/FIFOBuffChar.h" #ifdef HISTORY diff --git a/CMDList/CMDList.c b/CMDList/CMDList.c index d3233e5..a29db52 100644 --- a/CMDList/CMDList.c +++ b/CMDList/CMDList.c @@ -17,7 +17,8 @@ CMDList_t* CMDList_init() // does not free up the commands int CMDList_deinit(CMDList_t *list) { - CMDList_t** list_p = (CMDList_t**)list; + CMDList_t** list_p; + *list_p = list; int i; for (i = 0; i < 26; i++) @@ -28,7 +29,7 @@ int CMDList_deinit(CMDList_t *list) } } - free(*list_p); + free(list); return 0; } diff --git a/History/history.h b/History/history.h index 35bc020..04e2a8d 100644 --- a/History/history.h +++ b/History/history.h @@ -22,7 +22,7 @@ typedef struct History_s { extern History_t* History_init(); // destroy a fifo buffer (free up its space) -extern int History_deinit(History_t* history); +extern int History_deinit(History_t* history, bool freeLines); // put value i in buffer if there is still memory avaliable extern int History_put(History_t *history, char* line);