From dcc049e67d79c97838f83692fd5bdd2e361f4f1f Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 14 Feb 2024 00:56:31 +0100 Subject: Print correct binary sizes --- src/ahoy/emulator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3