aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-06 23:14:46 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-11-06 23:17:47 +0100
commitb31adacc241f5fb4b0421d6727f6dedb847fffd0 (patch)
tree02f9e33cc11c05dfc2ccd21d89533300077dfdb0
parentfdc1539d3c42e114c90805cde8cfabd132cc7944 (diff)
downloadsparse-b31adacc241f5fb4b0421d6727f6dedb847fffd0.tar.gz
arch: fix setting the endianness
The new --arch flag set arch_big_endian for big endian archs but didn't clear it for little endian ones. Fix it by simply copying the endianness from the arch table. Fixes: 2c06f143fa63394dbdfa07f3f9d00b24b7c902c5 Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index 4ecb43c7..fbf14282 100644
--- a/lib.c
+++ b/lib.c
@@ -1153,9 +1153,7 @@ static char **handle_arch(char *arg, char **next)
arch_m64 = ARCH_LP32;
else if (bits == 64 && arch_m64 == ARCH_LP32)
arch_m64 = ARCH_LP64;
- if (p->big_endian)
- arch_big_endian = 1;
-
+ arch_big_endian = p->big_endian;
break;
}
}