src/string_list.c

changeset 103
31fa205db85a
parent 102
665b60727a89
--- a/src/string_list.c	Sat Jul 04 12:09:37 2026 +0200
+++ b/src/string_list.c	Sat Jul 04 12:28:16 2026 +0200
@@ -33,13 +33,13 @@
 }
 
 string_list *new_string_list() {
-  string_list *stringList = malloc(sizeof(string_list));
-  stringList->count = 0;
-  stringList->capacity = 32;
-  stringList->items = calloc(stringList->capacity, sizeof(char*));
-  stringList->free_item = do_not_free;
+  string_list *list = malloc(sizeof(string_list));
+  list->count = 0;
+  list->capacity = 32;
+  list->items = calloc(list->capacity, sizeof(char*));
+  list->free_item = do_not_free;
 
-  return stringList;
+  return list;
 }
 
 void destroy_string_list(string_list *list) {
@@ -60,11 +60,11 @@
     list->items[list->count++] = item;
     return;
   }
-  size_t newCapacity = list->capacity * 2;
+  size_t new_cap = list->capacity * 2;
   char **reallocated_list =
-    realloc(list->items, sizeof(char*) * newCapacity);
+    realloc(list->items, sizeof(char*) * new_cap);
   assert(reallocated_list != NULL);
-  list->capacity = newCapacity;
+  list->capacity = new_cap;
   list->items = reallocated_list;
   list->items[list->count++] = item;
 }

mercurial