I already explained to you earlier how to find a "blank line" earlier in this thread. But I'll try again..
Code:
rc1 = fgets ( fbuff, 400, game_file_ptr );
if (rc1==NULL) {
printf("\n bad read1b4343"); // END OF A GAME
break;
}
While you definitely want to check the condition of fgets() returning NULL, that is not how you would check for a blank line in a file. You would check for a blank line by comparing the line to a newline by itself. Like so:
Code:
/* clean line with just \n */
if (strcmp(s, "\n") == 0)
printf("blank line\n");
/* OR */
/* ignore whitespace lines as well */
if (strcspn(s, " \t\n") == 0)
printf("blank line\n");
The strcspn is more flexible as you can add additional "reject" characters for things you want to ignore.