[Solved] where is the pthread segfault happening?

[ad_1]

  1. You use of strtok() is wrong:

    line = strtok(buffer, NULL);
    

    should be

    line = strtok(NULL, delim);
    

    Another mistakes should be fixed similarly.

  2. The elements of text_lines are uninitialized:

    text_lines = malloc(6000 * sizeof(char*));
    

    this allocated 6000 pointers to char, but none of these pointers are initialized.

0

[ad_2]

solved where is the pthread segfault happening?