diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/cbfstool/cbfstool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 9dbdc1c11a..721bf33fa2 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -339,9 +339,9 @@ int host_bigendian = 0; static void which_endian(void) { - char test[4] = "1234"; - uint32_t inttest = *(uint32_t *) test; - if (inttest == 0x31323334) { + static const uint32_t inttest = 0x12345678; + uint8_t inttest_lsb = *(uint8_t *)&inttest; + if (inttest_lsb == 0x12) { host_bigendian = 1; } } |