Tue, 20 Sep 2011 15:19:28 +0200
fixed makefile to run safely on compile errors + added -V option to cline
1 /*
2 * suffix_list.c
3 *
4 * Created on: 15.09.2011
5 * Author: beckermi
6 */
8 #include "suffix_list.h"
10 suffix_list_t* new_suffix_list_t() {
11 suffix_list_t* suffixList = malloc(sizeof(suffix_list_t));
12 suffixList->count = 0;
13 suffixList->items = NULL;
15 return suffixList;
16 }
18 void add_suffix(suffix_list_t* list, char* item) {
19 char** reallocated_list =
20 realloc(list->items, sizeof(char*) * list->count + 1);
21 if (reallocated_list != NULL) {
22 list->items = reallocated_list;
23 list->items[list->count] = item;
24 list->count++;
25 }
26 }