Skip to content

Commit

Permalink
plugins: adrv9002: fix profile configuration on windows
Browse files Browse the repository at this point in the history
We need to add the binary mode to 'fopen()' as it seems that windows treats
text files and binary files differently (on POSIX systems the b mode is
actually ignored). Otherwise, 'fread()' will actually return less bytes
than asked (with the size computed with fseek + ftell) and we will error
out before loading the stream. This fixes it and causes 'fread' to
return the expected number of bytes.

Signed-off-by: Nuno Sá <[email protected]>
  • Loading branch information
nunojsa committed Aug 11, 2021
1 parent adc9204 commit f8e1a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/adrv9002.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ static char *read_file(const char *file, ssize_t *f_size)
char *buf;
ssize_t size;

f = fopen(file, "r");
f = fopen(file, "rb");
if (!f)
return NULL;

Expand Down

0 comments on commit f8e1a4c

Please sign in to comment.