Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5

Thu, 15 Sep 2011 13:38:03 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 15 Sep 2011 13:38:03 +0200
changeset 11
06cbd0ec003d
parent 10
ecf787666f44 (current diff)
parent 9
1dd63a32ffc4 (diff)
child 12
902cb8d2053c

Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5

cline.c file | annotate | diff | comparison | revisions
cline.h file | annotate | diff | comparison | revisions
settings.c file | annotate | diff | comparison | revisions
suffix_list.c file | annotate | diff | comparison | revisions
suffix_list.h file | annotate | diff | comparison | revisions
--- a/settings.c	Thu Sep 15 13:29:06 2011 +0200
+++ b/settings.c	Thu Sep 15 13:38:03 2011 +0200
@@ -8,7 +8,7 @@
 #include "settings.h"
 
 settings_t* new_settings_t() {
-  settings_t *settings = malloc(sizeof(settings_t*));
+  settings_t *settings = malloc(sizeof(settings_t));
   if (settings != NULL) {
   #ifdef _WIN32
     settings->fileSeparator      = '\\';
@@ -25,6 +25,6 @@
 }
 
 void destroy_settings_t(settings_t* settings) {
-  destroy_suffix_list_t(settings->suffixList);
+  free(settings->suffixList);
   free(settings);
 }
--- a/suffix_list.c	Thu Sep 15 13:29:06 2011 +0200
+++ b/suffix_list.c	Thu Sep 15 13:38:03 2011 +0200
@@ -8,23 +8,16 @@
 #include "suffix_list.h"
 
 suffix_list_t* new_suffix_list_t() {
-  suffix_list_t* suffixList = malloc(sizeof(suffix_list_t*));
+  suffix_list_t* suffixList = malloc(sizeof(suffix_list_t));
   suffixList->count = 0;
   suffixList->items = NULL;
 
   return suffixList;
 }
 
-void destroy_suffix_list_t(suffix_list_t* list) {
-  while (--list->count >= 0) {
-    free(list->items[list->count]);
-  }
-  free(list);
-}
-
 void add_suffix(suffix_list_t* list, char* item) {
   char** reallocated_list =
-    realloc(list->items, sizeof(char**) * list->count + 1);
+    realloc(list->items, sizeof(char*) * list->count + 1);
   if (reallocated_list != NULL) {
     list->items = reallocated_list;
     list->items[list->count] = item;
--- a/suffix_list.h	Thu Sep 15 13:29:06 2011 +0200
+++ b/suffix_list.h	Thu Sep 15 13:38:03 2011 +0200
@@ -20,7 +20,6 @@
 #endif
 
 suffix_list_t* new_suffix_list_t();
-void destroy_suffix_list_t(suffix_list_t*);
 void add_suffix(suffix_list_t*, char*);
 
 #ifdef _cplusplus

mercurial