Commit 926af6aba1ef16d0a7da2607e646b1957d836068

Thomas de Grivel 2023-02-02T18:30:46

wip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/libc3/facts.c b/libc3/facts.c
index f1ef649..25df55c 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -257,8 +257,13 @@ sw facts_load (s_facts *facts, s_buf *buf)
   result += r;
   i++;
   if (hash_u64_buf != hash_u64) {
-    warnx("facts_load: invalid hash line %lu: 0x%llx",
-          (unsigned long) i + 3, hash_u64);
+    s_buf tmp;
+    buf_init_alloc(&tmp, 16);
+    buf_inspect_u64_hex(&tmp, hash_u64);
+    buf_write_s8(&tmp, 0);
+    warnx("facts_load: invalid hash line %lu: 0x%s",
+          (unsigned long) i + 3,
+          tmp.ptr.ps8);
     return -1;
   }
   return result;