mirror of
https://github.com/tcarmelveilleux/dcc6502.git
synced 2024-06-12 15:29:35 +00:00
Merge pull request #3 from ratherlargerobot/fread-brk-bugfix
Use fread() return value to count bytes
This commit is contained in:
commit
680c212992
|
@ -769,8 +769,8 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
byte_count = 0;
|
byte_count = 0;
|
||||||
while(!feof(input_file) && ((options.org + byte_count) <= 0xFFFFu) && (byte_count < options.max_num_bytes)) {
|
while(!feof(input_file) && ((options.org + byte_count) <= 0xFFFFu) && (byte_count < options.max_num_bytes)) {
|
||||||
fread(&buffer[options.org + byte_count], 1, 1, input_file);
|
size_t bytes_read = fread(&buffer[options.org + byte_count], 1, 1, input_file);
|
||||||
byte_count++;
|
byte_count += bytes_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(input_file);
|
fclose(input_file);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user