From: Alan Cox Date: Thu, 5 Oct 2017 23:07:51 +0000 (+0100) Subject: sgetl: sometimes C typing is perverse X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6694e4d42aeb4bab652f99bb1c1e2b4b37aec465;p=FUZIX.git sgetl: sometimes C typing is perverse --- diff --git a/Library/libs/sgetl.c b/Library/libs/sgetl.c index a9408ccf..2b9080ac 100644 --- a/Library/libs/sgetl.c +++ b/Library/libs/sgetl.c @@ -7,9 +7,9 @@ long sgetl(const char *buffer) uint32_t r; r = *p++; - r |= (*p++ << 8); - r |= (*p++ << 16); - r |= (*p << 24); + r |= (((uint16_t)*p++) << 8); + r |= (((uint32_t)*p++) << 16); + r |= (((uint32_t)*p) << 24); return (long)r; }