diff --git a/source/bforce/prot_hydra.c b/source/bforce/prot_hydra.c index 7c7e15c..ae416f7 100644 --- a/source/bforce/prot_hydra.c +++ b/source/bforce/prot_hydra.c @@ -286,10 +286,10 @@ static char *hydra_putword(char *buf, int val) static long hydra_getlong(const char *buf) { - return ( (uint32_t) ((uint8_t) buf[0]) ) + return (int32_t)(( (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 ); + | ( (uint32_t) ((uint8_t) buf[3]) << 24 )); //return ( buf[3]<<24 | buf[2]<<16 | buf[1]<<8 | buf[0]); }