Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 49 struct lines * getLines(struct lines * arg1, char * input, char * seperator)
- 50 {
- 51 char * inputCopy = malloc(strlen(input));
- 52 memcpy(inputCopy, input, strlen(input));
- 53 char * line;
- 54 line = strtok(input,seperator);
- 55 int l =0;
- 56 while (line != NULL)
- 57 {
- 58 sprintf(arg1[l].line, line);
- 59 if (DEBUG)
- 60 printf("%s\n",arg1[l].line);
- 61 line = strtok(NULL, seperator);
- 62 l++;
- 63 }
- 64 arg1->linecount = l;
- 65 free(line);
- 66
- 67 memmove(input, inputCopy, strlen(inputCopy));
- 68 return arg1;
- 69 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement