diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2022-05-23 12:52:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 12:52:44 +0200 |
commit | 10ed4136f74beb458c6d014fcc6b53b5d02dd6c5 (patch) | |
tree | 8c518a5120f1edf1a6015c040e3e87c96f2668c1 | |
parent | 9f66f9ce16941c6417813cb87653c735a78b53ae (diff) | |
parent | 848f6a874e3ef24dabf5f9267a725bb974cfea01 (diff) | |
download | icestorm-10ed4136f74beb458c6d014fcc6b53b5d02dd6c5.tar.gz icestorm-10ed4136f74beb458c6d014fcc6b53b5d02dd6c5.tar.bz2 icestorm-10ed4136f74beb458c6d014fcc6b53b5d02dd6c5.zip |
Merge pull request #296 from RafaelLeeImg/merge_request_float_exception
Fix float exception when value is less than 100
-rw-r--r-- | iceprog/iceprog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index 20b05a4..f80a432 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -967,7 +967,7 @@ int main(int argc, char **argv) if (rc <= 0) break; fprintf(stderr, " \r"); - fprintf(stderr, "addr 0x%06X %3ld%%\r", rw_offset + addr, addr / (file_size / 100)); + fprintf(stderr, "addr 0x%06X %3ld%%\r", rw_offset + addr, 100 * addr / file_size); flash_write_enable(); flash_prog(rw_offset + addr, buffer, rc); flash_wait(); @@ -989,7 +989,7 @@ int main(int argc, char **argv) for (int addr = 0; addr < read_size; addr += 256) { uint8_t buffer[256]; fprintf(stderr, " \r"); - fprintf(stderr, "addr 0x%06X %3d%%\r", rw_offset + addr, addr / (read_size / 100)); + fprintf(stderr, "addr 0x%06X %3d%%\r", rw_offset + addr, 100 * addr / read_size); flash_read(rw_offset + addr, buffer, 256); fwrite(buffer, read_size - addr > 256 ? 256 : read_size - addr, 1, f); } @@ -1003,7 +1003,7 @@ int main(int argc, char **argv) if (rc <= 0) break; fprintf(stderr, " \r"); - fprintf(stderr, "addr 0x%06X %3ld%%\r", rw_offset + addr, addr / (file_size / 100)); + fprintf(stderr, "addr 0x%06X %3ld%%\r", rw_offset + addr, 100 * addr / file_size); flash_read(rw_offset + addr, buffer_flash, rc); if (memcmp(buffer_file, buffer_flash, rc)) { fprintf(stderr, "Found difference between flash and file!\n"); |