diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-06 18:33:29 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-06 18:33:29 +0400 |
commit | 2b416c9def1711e6e2562c82eca70ea81708f4cb (patch) | |
tree | a8022af29f0dfd36bc2770f5687f7d6f0e9ef935 /output | |
parent | 0d551103130191d9b88316fd5be7072aa9e90f07 (diff) | |
download | nasm-2b416c9def1711e6e2562c82eca70ea81708f4cb.tar.gz nasm-2b416c9def1711e6e2562c82eca70ea81708f4cb.tar.bz2 nasm-2b416c9def1711e6e2562c82eca70ea81708f4cb.zip |
BR3025702: outbin -- Fix byte ordering
In commit 55ae12052cd1 we occasionally broke byte ordering. Fix it.
Note that current stable version 2.08.01 is not affected by this bug.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output')
-rw-r--r-- | output/outbin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/output/outbin.c b/output/outbin.c index 70a5099..c994713 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -545,8 +545,8 @@ static void bin_cleanup(int debuginfo) saa_fread(r->target->contents, r->posn, mydata, r->bytes); p = q = mydata; l = 0; - for (b = 0; b < r->bytes; b++) - l = (l << 8) + *p++; + for (b = 0; b < r->bytes; b++) + l += p[b] << (b * 8); s = find_section_by_index(r->secref); if (s) { |