In the following code, I'm attempting to store all characters from a file (including newlines). If a newline is read, variable 'i' should be incremented and 'j' reset to 0, but this doesn't happen. I've confirmed that the newlines are in fact being read and stored, by printing from my array to console.
void scan_solved_nonogram(board *b) {
FILE *file = fopen("test.txt", "r");
int i = 0, j = 0;
while( ( b->symbol[i][j] = getc(file) ) != EOF ) {
j++;
if( b->symbol[i][j] == '\n' ) {
i++;
j = 0;
}
}
fclose(file);
b->size_i = i;
b->size_j = j;
}