Skip to content

Commit

Permalink
Reorder includes
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 4, 2024
1 parent 55d3b2e commit 49d3d5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion c/src/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ char *get_data_file(const char *name) {
}

const size_t ret_code = fread(buffer, 1, length, file);
if (ret_code != length)
if (ret_code != length) {
if (feof(file))
printf("Error reading %s: unexpected end of file, read %" PRIu64 " of %"PRIu64" bytes expected\n", name, (uint64_t)ret_code, (uint64_t)length);
else if (ferror(file))
perror("Error reading data file");
}

buffer[length] = 0;
fclose(file);
Expand Down
2 changes: 1 addition & 1 deletion c/test.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#define UNITY_SUPPORT_TEST_CASES
#include "Unity/src/unity.h"
#include <stdint.h>
#include <inttypes.h>
#include "src/include/utils.h"
#include "Unity/src/unity.h"
#include "src/p0001.c"
#include "src/p0002.c"
#include "src/p0003.c"
Expand Down

0 comments on commit 49d3d5d

Please sign in to comment.