lovrRandomGeneratorGetState: Improve correctness;

This commit is contained in:
bjorn 2018-10-24 09:50:00 -07:00
parent 0f54190a9f
commit 9010af3ea4
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
// Thomas Wang's 64-bit integer hashing function:
// https://web.archive.org/web/20110807030012/http://www.cris.com/%7ETtwang/tech/inthash.htm
@ -47,7 +48,7 @@ void lovrRandomGeneratorSetSeed(RandomGenerator* generator, Seed seed) {
}
void lovrRandomGeneratorGetState(RandomGenerator* generator, char* state, size_t length) {
snprintf(state, length, "0x%16llx", generator->state.b64);
snprintf(state, length, "0x%" PRIx64, generator->state.b64);
}
int lovrRandomGeneratorSetState(RandomGenerator* generator, const char* state) {