From 11bbf3c4ff4ec320f8016d65abf6ed116622899d Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 4 Dec 2020 19:54:15 -0500 Subject: [PATCH] correct endianness for cell_simple_p() --- src/lib/egcpool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/egcpool.h b/src/lib/egcpool.h index c4e222967..e42521803 100644 --- a/src/lib/egcpool.h +++ b/src/lib/egcpool.h @@ -252,13 +252,13 @@ egcpool_dump(egcpool* pool){ // unsafe results if called on a simple cell. static inline uint32_t cell_egc_idx(const cell* c){ - return htole(c->gcluster) & 0x00fffffflu; + return (htole(c->gcluster) & 0xffffff00lu) >> 8u; } // Is the cell simple (a UTF8-encoded EGC of four bytes or fewer)? static inline bool cell_simple_p(const cell* c){ - return (htole(c->gcluster) & 0xff000000ul) != 0x01000000ul; + return (htole(c->gcluster) & 0xffu) != 0x01u; } // only applies to complex cells, do not use on simple cells