Did not you intend to pass "size" and "1" the other way around to fpread?
Like this:
Code: Select all
fpread(data.data, 1, size,
data.size - data.remaining_size, file);
Code: Select all
fpread(data.data, 1, size,
data.size - data.remaining_size, file);