aboutsummaryrefslogtreecommitdiff
path: root/src/hash/sdbm.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-08-26 16:13:19 -0500
committerame <[email protected]>2024-08-26 16:13:25 -0500
commitfda120441cabfefc511786d7a6af40eec9f181fa (patch)
tree5d6e80abc948ba0034d3b4f32bba6746d95735e5 /src/hash/sdbm.c
parent90c4b7dcbc57d2f86a77c997069d96158d54ca55 (diff)
use integer format macros
Diffstat (limited to 'src/hash/sdbm.c')
-rw-r--r--src/hash/sdbm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hash/sdbm.c b/src/hash/sdbm.c
index a2f1acc..2387301 100644
--- a/src/hash/sdbm.c
+++ b/src/hash/sdbm.c
@@ -1,6 +1,7 @@
#include "../crypto.h"
#include <stdio.h>
#include <stdint.h>
+#include <inttypes.h>
struct sdbm_hash sdbm_init(){
return (struct sdbm_hash){.hash = 0};
@@ -30,7 +31,7 @@ int l_sdbm_final(lua_State* L){
struct sdbm_hash* a = (struct sdbm_hash*)lua_touserdata(L, 1);
uint64_t u = sdbm_final(a);
char digest[64];
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}
@@ -43,7 +44,7 @@ int l_sdbm(lua_State* L){
char digest[64];
uint64_t u = sdbm(a, len);
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}