Can anybody pls tell me why am I getting segmentation fault (core dumped) for this piece of code?
//Reading from the card.txt file
char *cards[54];
char *child_cards[54];
for(i=0; i<54; i++){
    cards[i] = malloc(100);
    child_cards[i] = malloc(100);
}
char buff[BUFSIZE];
char *p = NULL;
FILE *fp;
fp = fopen(argv[3], "r"); 
while(fgets(buff, 999, fp) != NULL) 
{
    p = strtok (buff," ");
    while (p != NULL)
    {
        strcpy(cards[total_card], p);
        p = strtok (NULL, " ");           
        total_card += 1;
    }
}
fclose(fp);
 
    