From 80e1a7779a2f90af6fa0e0f358588fecf07c7b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sat, 10 Apr 2021 17:20:14 +0300 Subject: [PATCH] Ah, integer promotion rules --- puer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/puer.c b/puer.c index 4aee633..c204237 100644 --- a/puer.c +++ b/puer.c @@ -66,7 +66,7 @@ void xxtea128(uint32_t const key[4], uint32_t block[4]) { } uint32_t bytes2word(unsigned char const bytes[4]) { - return bytes[0] | bytes[1]<<8 | bytes[2]<<16 | bytes[3]<<24; + return (uint32_t)bytes[0] | (uint32_t)bytes[1]<<8 | (uint32_t)bytes[2]<<16 | (uint32_t)bytes[3]<<24; } void word2bytes(unsigned char *bytes, uint32_t word) {