Skip to content

Commit d10ff12

Browse files
committed
tests/tests.c: open text file in binary mode
If the file is opened and read in text mode in Windows, the line endings will be translated and thus the stat() and fread() return different sizes.
1 parent a42cb47 commit d10ff12

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static const char *read_file_to_string(const char *file)
121121
buf = (char *)malloc(size + 1);
122122
TT_ASSERT_PTR_NOTNULL(buf);
123123

124-
fp = fopen(file, "rt");
124+
fp = fopen(file, "rb");
125125
TT_ASSERT_PTR_NOTNULL(fp);
126126

127127
r = fread(buf, 1, size, fp);

0 commit comments

Comments
 (0)