From 162a22f0a465120371db24ae71fcd0929d27a22d Mon Sep 17 00:00:00 2001 From: Alexey Khromov Date: Sat, 26 Apr 2025 10:21:04 +0300 Subject: [PATCH] Revert prot_hydra.c getlong function bitshifting --- source/bforce/prot_hydra.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/bforce/prot_hydra.c b/source/bforce/prot_hydra.c index 0b19261..7c7e15c 100644 --- a/source/bforce/prot_hydra.c +++ b/source/bforce/prot_hydra.c @@ -286,11 +286,11 @@ static char *hydra_putword(char *buf, int val) static long hydra_getlong(const char *buf) { - //return ( (unsigned long) ((unsigned char) buf[0]) ) - // | ( (unsigned long) ((unsigned char) buf[1]) << 8 ) - // | ( (unsigned long) ((unsigned char) buf[2]) << 16 ) - // | ( (unsigned long) ((unsigned char) buf[3]) << 24 ); - return ( buf[3]<<24 | buf[2]<<16 | buf[1]<<8 | buf[0]); + return ( (uint32_t) ((uint8_t) buf[0]) ) + | ( (uint32_t) ((uint8_t) buf[1]) << 8 ) + | ( (uint32_t) ((uint8_t) buf[2]) << 16 ) + | ( (uint32_t) ((uint8_t) buf[3]) << 24 ); + //return ( buf[3]<<24 | buf[2]<<16 | buf[1]<<8 | buf[0]); } static int hydra_getword(const char *buf)