diff --git a/malloc.c b/malloc.c index 18772c7..dd7b794 100644 --- a/malloc.c +++ b/malloc.c @@ -274,11 +274,9 @@ static void write_after_free_check(char *p, size_t size) { } } -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -static const uint64_t canary_mask = 0xffffffffffffff00UL; -#else -static const uint64_t canary_mask = 0x00ffffffffffffffUL; -#endif +static const uint64_t canary_mask = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ? + 0xffffffffffffff00UL : + 0x00ffffffffffffffUL; static void set_canary(struct slab_metadata *metadata, void *p, size_t size) { memcpy((char *)p + size - canary_size, &metadata->canary_value, canary_size);