line
needs to be initialized before the call to getline()
and ...
getline()
returns -1 on failure to read a line (including end-of-file condition). In the event of an error, errno is set to indicate the cause.".
Use -1 as EOF
is not necessarily -1.
char *lineptr = NULL;
size_t n = 0;
...
while(getline(&lineptr, &n, dic) != -1)
Note: robust code would use
size_t dic_word_count, crack_word_count, crack_line_count;
...
printf("%zu", crack_line_count);