readLittleEndian(): Fix 64-bit integer truncation

Fixes #6939.
This commit is contained in:
Eelco Dolstra 2022-08-26 13:10:42 +02:00
parent 13c0db4d06
commit def7b251d0

View file

@ -512,7 +512,7 @@ T readLittleEndian(unsigned char * p)
{
T x = 0;
for (size_t i = 0; i < sizeof(x); ++i)
x |= *p++ << (i * 8);
x |= ((T) *p++) << (i * 8);
return x;
}