// Split a line up by spaces void handleLine(char line[], int fileIndex) { char* tok; int offset = 0; while((tok = strsep(*(&line+offset)," ")) != NULL) { printf("Token: %s\tOffset: %d\n",tok,offset); offset = offset+(strlen(tok)*sizeof(line)); } } // Produces a segmentation fault - gives funky results if I replace strsep with strtok (i.e. works fine for first few 'words' and then seg faults