aboutsummaryrefslogtreecommitdiff
path: root/lib/list.c
diff options
context:
space:
mode:
authorgabrielgio <gabrielgio@workstation.lan>2024-02-17 17:13:07 +0100
committergabrielgio <gabrielgio@workstation.lan>2024-02-17 17:13:07 +0100
commit0a2e62f57734f820cd20e151d1150342408552ed (patch)
treee1e9c786571bf1d856ba42c4c6cf014b008822c4 /lib/list.c
parent78b0ba12073b0940541d91a7568e8b7ada572848 (diff)
downloaddict-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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/list.c b/lib/list.c
index fc0fddf..52feb76 100644
--- a/lib/list.c
+++ b/lib/list.c
@@ -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;