int llistAdd(LList list, char const *text) { //LListNode *first = (LListNode *)malloc(sizeof(LListNode)); LListNode *new = (LListNode *)malloc(sizeof(LListNode)); LListNode *prev = (LListNode *)malloc(sizeof(LListNode)); if (new == NULL) return 0; new->text = (char *)malloc(sizeof(char)*(strlen(text)+1)); strcpy(new->text, text); new->next = NULL; if (list->first == NULL) list->first = new; else { for (prev = list->first; prev != NULL; prev = prev->next) { prev->next = new; } } return 1; }