use strsep instead of strtok to avoid a segfault