This commit is contained in:
Eelco Dolstra 2022-12-12 12:40:51 +01:00
parent f3d1e92856
commit 786402365e

View file

@ -515,8 +515,9 @@ template<typename T>
T readLittleEndian(unsigned char * p) T readLittleEndian(unsigned char * p)
{ {
T x = 0; T x = 0;
for (size_t i = 0; i < sizeof(x); ++i) for (size_t i = 0; i < sizeof(x); ++i, ++p) {
x |= ((T) *p++) << (i * 8); x |= ((T) *p) << (i * 8);
}
return x; return x;
} }