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 | 390432976fc02cdf3db5c87b3dde2d5136f3c900 (patch) | |
tree | f268ea36c90e3c8f45a98891bad070c3f357022d /bfd/srec.c | |
parent | e9955ede010d0edd64e2bc61050cb252c93fb62f (diff) | |
download | gdb-390432976fc02cdf3db5c87b3dde2d5136f3c900.tar.gz |
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
diff --git a/bfd/srec.c b/bfd/srec.c index aefdc64167c..bce2efe3303 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -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; |