From e7990709edc69f870bf702e0f0fe9e10e1e9cdb3 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Wed, 3 Jan 2024 21:30:07 +0300 Subject: [PATCH] reverse-ramdisk.c: improve format of read IR --- c-programming/reverse-ramdisk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c-programming/reverse-ramdisk.c b/c-programming/reverse-ramdisk.c index 8a4b16d..e7823d0 100644 --- a/c-programming/reverse-ramdisk.c +++ b/c-programming/reverse-ramdisk.c @@ -284,8 +284,9 @@ int tf_read(int ID, size_t offset, void* dest, size_t data_size) { printf("Read: ID = %d, src = %p, size = %zu -> '", ID, dest, data_size); for (size_t i = 0; i < data_size; i++) - printf("0x%02" PRIX8 " ", *((uint8_t*)((uint8_t*)dest + i))); - printf("'\n"); + printf("0x%02" PRIX8 "%c", *((uint8_t*)((uint8_t*)dest + i)), + i == (data_size - 1) ? '\'' : ' '); + printf("\n"); fflush(stdout); #endif