diff options
| author | ame <[email protected]> | 2024-08-26 16:13:19 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-08-26 16:13:25 -0500 |
| commit | 7a15e796e8789b51a459af7fe890e02a416e1fc7 (patch) | |
| tree | 5d6e80abc948ba0034d3b4f32bba6746d95735e5 /src/hash/fasthash.c | |
| parent | 064376146afad7af0b496014c59ba4b4f78d4c78 (diff) | |
use integer format macros
Diffstat (limited to 'src/hash/fasthash.c')
| -rw-r--r-- | src/hash/fasthash.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/hash/fasthash.c b/src/hash/fasthash.c index b27b6b9..12ec3be 100644 --- a/src/hash/fasthash.c +++ b/src/hash/fasthash.c @@ -1,6 +1,5 @@ -#include "../util.h"
#include "../crypto.h"
-#include <stdio.h>
+#include <inttypes.h>
#include <stdint.h>
//almost entirely taken from https://github.com/ztanml/fast-hash/blob/master/fasthash.c
@@ -62,7 +61,7 @@ int l_fasthash64(lua_State* L){ char digest[64];
uint64_t u = fasthash64(a, len, seed);
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}
@@ -77,7 +76,7 @@ int l_fasthash32(lua_State* L){ char digest[32];
uint32_t u = fasthash32(a, len, seed);
- sprintf(digest,"%04x",u);
+ sprintf(digest,"%04"PRIx32,u);
lua_pushstring(L, digest);
return 1;
}
|
