I have this small piece of code:

```
int* index=(int*)(sizeof(int)*NB);
while(i < NB){
    printf("i=%d, pch=%s\n", i, pch);
    if (strcmp(pch, SPLIT_PATTERN))
      i++;
    else
      index[k++]=i-1;
    pch = strtok(NULL, "-");
  }

```

and with this input:

```
file_content EN7FSQcL63NRUQHSBBRDtVUkobmStQbKdL2cR7gpoC5-X2rS1Cu2RCYaw0TiGdYUUtYuCTB5WlE9Y3SJNuiimQC-ajksldnalmcjlakjflksjoi-
NB = 2
SPLIT_PATTERN = ajksldnalmcjlakjflksjoi (the last part in file_content)

```

C give me the segmentation fault error.

```
i=0, pch=EN7FSQcL63NRUQHSBBRDtVUkobmStQbKdL2cR7gpoC5
i=1, pch=X2rS1Cu2RCYaw0TiGdYUUtYuCTB5WlE9Y3SJNuiimQC
Segmentation fault (core dumped)

```

Please let me know where I do it wrong?