Skip to content

Commit

Permalink
try fread whole file and rewind
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGAzed committed Jun 23, 2024
1 parent 86ff3e9 commit 67bed39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion program/source/structures/concrete/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@ ksize_t _empty_cell_count(KGrid from);

Kakuro init_kakuro(FILE * kakuro_file) {
assert(kakuro_file && "KAKURO FILE POINTER IS NULL");
ksize_t c;
do {
fread(&c, sizeof(ksize_t), 1, kakuro_file);
printf ("%02x ", c);
} while (!feof(kakuro_file));
fflush(stdout);

rewind(kakuro_file);
assert(!feof(kakuro_file) && "KAKURO FILE STREAM IS AT THE END");

Kakuro k = { 0 };
_kakuro_alloc(&k, kakuro_file);
Expand Down

0 comments on commit 67bed39

Please sign in to comment.