again boring misalignment fixes

This commit is contained in:
nillerusr
2022-08-09 21:24:27 +03:00
parent c5607661f0
commit 08073ae622
5 changed files with 13 additions and 15 deletions

View File

@@ -267,7 +267,9 @@ unsigned int MD5_PseudoRandom(unsigned int nSeed)
MD5Update(&ctx, (unsigned char*)&nSeed, sizeof(nSeed) );
MD5Final(digest, &ctx);
return *(unsigned int*)(digest+6); // use 4 middle bytes for random value
unsigned int rand;
memcpy(&rand, digest+6, sizeof(rand)); // use 4 middle bytes for random value
return rand;
}
//-----------------------------------------------------------------------------