From 20a6d4d20d3018611285b0135c14999ba78e6693 Mon Sep 17 00:00:00 2001 From: TheGAzed Date: Sun, 23 Jun 2024 18:36:26 +0200 Subject: [PATCH] another try --- program/source/structures/concrete/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/program/source/structures/concrete/board.c b/program/source/structures/concrete/board.c index 790b64f..6570e06 100644 --- a/program/source/structures/concrete/board.c +++ b/program/source/structures/concrete/board.c @@ -16,6 +16,7 @@ ksize_t _empty_cell_count(KGrid from); Kakuro init_kakuro(FILE * kakuro_file) { assert(kakuro_file && "KAKURO FILE POINTER IS NULL"); + rewind(kakuro_file); Kakuro k = { 0 }; _kakuro_alloc(&k, kakuro_file); @@ -104,8 +105,6 @@ KGrid _init_grid(FILE * kakuro_file) { assert(fread(&(g.size[ROW]), sizeof(ksize_t), 1, kakuro_file)); assert(fread(&(g.size[COLUMN]), sizeof(ksize_t), 1, kakuro_file)); - assert(g.size[ROW] && "ROW COUNT IS ZERO"); - assert(g.size[COLUMN] && "COLUMN COUNT IS ZERO"); g.count = g.size[ROW] * g.size[COLUMN]; assert((g.grids[ROW] = malloc(g.size[ROW] * sizeof(lookup_t*))) && "ALLOCATION TO ROW ARRAY FAILED");