Merge pull request #3 from ratherlargerobot/fread-brk-bugfix

Use fread() return value to count bytes
This commit is contained in:
Tennessee Carmel-Veilleux 2018-09-02 15:28:46 -04:00 committed by GitHub
commit 680c212992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -769,8 +769,8 @@ int main(int argc, char *argv[]) {
byte_count = 0;
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);
byte_count++;
size_t bytes_read = fread(&buffer[options.org + byte_count], 1, 1, input_file);
byte_count += bytes_read;
}
fclose(input_file);