aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-14 00:56:31 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-14 00:56:31 +0100
commitdcc049e67d79c97838f83692fd5bdd2e361f4f1f (patch)
treee376c0fd39347e60d2129166fc902e58bea45c21
parente38017f8ce131d8cffbd56ac3d2b5cba6091abe5 (diff)
Print correct binary sizes
-rw-r--r--src/ahoy/emulator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ahoy/emulator.c b/src/ahoy/emulator.c
index 4ada357..34e31ad 100644
--- a/src/ahoy/emulator.c
+++ b/src/ahoy/emulator.c
@@ -76,8 +76,10 @@ emulate(struct u8view prog)
{
struct timespec tp;
- if (prog.len > MEM_FREE)
- diex("%s: binary of size %zu KiB too large to fit in RAM", "TODO", 0ul);
+ if (prog.len > MEM_FREE) {
+ diex("%s: binary of size %.1f KiB exceeds %d B maximum", "TODO",
+ (double)prog.len / 1024, MEM_FREE);
+ }
PC = MEM_RESERVED;
memcpy(mem + PC, prog.p, prog.len);