fgets() C: Why when the next line of a file is empty it returns me the last line read? How can I fix that?

I am trying to read the following text file: Life is beautiful (blank) The 1st line has \n at the end, that makes the cursor to go to the next line (empty line \0). When I try to read it with fgets: char text_file[100]; FILE *txt; txt = fopen(“a.txt”,”r”); while (!feof(txt)) { fgets(text_file, max_size,txt); printf(“%s”,text_file);…

Details