diff options
author | gabrielgio <gabrielgio@workstation.lan> | 2024-02-17 17:13:07 +0100 |
---|---|---|
committer | gabrielgio <gabrielgio@workstation.lan> | 2024-02-17 17:13:07 +0100 |
commit | 0a2e62f57734f820cd20e151d1150342408552ed (patch) | |
tree | e1e9c786571bf1d856ba42c4c6cf014b008822c4 /lib/list.c | |
parent | 78b0ba12073b0940541d91a7568e8b7ada572848 (diff) | |
download | dict-0a2e62f57734f820cd20e151d1150342408552ed.tar.gz dict-0a2e62f57734f820cd20e151d1150342408552ed.tar.bz2 dict-0a2e62f57734f820cd20e151d1150342408552ed.zip |
ref: Apply astyle --style=linux
Diffstat (limited to 'lib/list.c')
-rw-r--r-- | lib/list.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -4,8 +4,7 @@ LIST* list_add(LIST* list, void* item) { - if (list == NULL) - { + if (list == NULL) { list = (LIST*)malloc(sizeof(LIST)); list->size = 0; list->list = (void**)malloc(sizeof(0)); @@ -35,20 +34,21 @@ LIST* list_remove(LIST* list, unsigned int pos) return list; } -void list_free(LIST* list) { - for (unsigned int x = 0; x < list->size; x++) +void list_free(LIST* list) +{ + for (unsigned int x = 0; x < list->size; x++) free(list->list[x]); free(list->list); free(list); } - -void *list_get(LIST *list, unsigned int index) { +void *list_get(LIST *list, unsigned int index) +{ if (list == NULL) return NULL; - if (index < list->size) + if (index < list->size) return list->list[index]; return NULL; |