From cf2b617b3930f312a3d06505ee9045e790f533e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Thu, 8 Apr 2021 20:25:07 +0300 Subject: [PATCH] C conversion to unsigned types implictly mods --- puer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/puer.c b/puer.c index ec8d4c5..e809a51 100644 --- a/puer.c +++ b/puer.c @@ -56,9 +56,9 @@ uint32_t bytes2word(unsigned char const bytes[4]) { } void word2bytes(unsigned char *bytes, uint32_t word) { - bytes[0] = word & 0xff; - bytes[1] = word>>8 & 0xff; - bytes[2] = word>>16 & 0xff; + bytes[0] = word; + bytes[1] = word>>8; + bytes[2] = word>>16; bytes[3] = word>>24; }