summaryrefslogtreecommitdiff
path: root/src/benc.c
diff options
context:
space:
mode:
authorJesper Jensen <jesper@jnsn.dev>2025-07-18 09:32:16 +0200
committerJesper Jensen <jesper@jnsn.dev>2025-07-18 09:32:33 +0200
commit69528489cddd27b4d4b9411d00b60cccc175b0e8 (patch)
treeeeed9d13f99858b3fd5660bc8d57e86bf81088a3 /src/benc.c
parenta46e9a5cbb8fc233a0ccb47708e7686c2b561ac0 (diff)
Add a simple API for lookups
Diffstat (limited to 'src/benc.c')
-rw-r--r--src/benc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/benc.c b/src/benc.c
index c2c2782..9842dd9 100644
--- a/src/benc.c
+++ b/src/benc.c
@@ -56,7 +56,7 @@ void benc_print(const struct benc_node* stream, size_t stream_len) {
switch(cursor->type) {
case BNT_INT:
indent(depth);
- printf("INT %.*s\n", cursor->size, cursor->loc);
+ printf("INT %.*s\n", (int)cursor->size, cursor->loc);
break;
case BNT_STRING:
indent(depth);
@@ -69,7 +69,7 @@ void benc_print(const struct benc_node* stream, size_t stream_len) {
}
printf("STR ");
if(allprint) {
- printf("%.*s", cursor->size, cursor->loc);
+ printf("%.*s", (int)cursor->size, cursor->loc);
} else {
for (const unsigned char* c = (const unsigned char*)cursor->loc; c < (unsigned char*)(cursor->loc + cursor->size); c++) {
printf("\\x%02X", *c);