Parsing a huge text file gives me a segmentation : I am trying to parse a relatively big text file in C. I cannot use malloc or realloc. Words should be tokenized based on "/" as you can see. However the code below gives me a segmenation error even if i change the size of the array.

    char buf[1000];
    char *token;
    char tags[500][1000];
    FILE *fp = fopen("file.txt", "r");

    for (i = 0; fgets(buf, sizeof(buf), fp);) {

				token = strtok(buf, " /");
				while (token != NULL) {
					strcpy(tags[i], token);
					i++;
					token = strtok(NULL, " /");
				}
			}