diff options
author | Nick Clifton <nickc@redhat.com> | 2000-01-13 22:10:36 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-01-13 22:10:36 +0000 |
commit | 9a968f43323ca8e2e800d0382bac9fbf9ad9b396 (patch) | |
tree | e849045af355b8a60a7a21fea3575bafcf380ec3 /bfd/srec.c | |
parent | f45fbf876deab0568bd359788dbdaeabf4f22967 (diff) | |
download | gdb-9a968f43323ca8e2e800d0382bac9fbf9ad9b396.zip gdb-9a968f43323ca8e2e800d0382bac9fbf9ad9b396.tar.gz gdb-9a968f43323ca8e2e800d0382bac9fbf9ad9b396.tar.bz2 |
Apply Tim walls octest vs bytes patch
Diffstat (limited to 'bfd/srec.c')
-rw-r--r-- | bfd/srec.c | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -1000,31 +1000,28 @@ srec_write_section (abfd, tdata, list) tdata_type *tdata; srec_data_list_type *list; { - unsigned int bytes_written = 0; + unsigned int octets_written = 0; bfd_byte *location = list->data; - while (bytes_written < list->size) + while (octets_written < list->size) { bfd_vma address; + unsigned int octets_this_chunk = list->size - octets_written; - unsigned int bytes_this_chunk = list->size - bytes_written; + if (octets_this_chunk > CHUNK) + octets_this_chunk = CHUNK; - if (bytes_this_chunk > CHUNK) - { - bytes_this_chunk = CHUNK; - } - - address = list->where + bytes_written; + address = list->where + octets_written / bfd_octets_per_byte (abfd); if (! srec_write_record (abfd, tdata->type, address, location, - location + bytes_this_chunk)) + location + octets_this_chunk)) return false; - bytes_written += bytes_this_chunk; - location += bytes_this_chunk; + octets_written += octets_this_chunk; + location += octets_this_chunk; } return true; |