From 46b31f3864e19ab09dc3b85e479371e5192ceabf Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 2 Apr 2022 08:41:07 -0500 Subject: [PATCH] Update: Do not use sizeof(char_t) for explicitly handling 1 byte. The char_t could potentially be of some size other than 1. This read is per-byte and not per-character. Normally these or true, but some special architectures this might not be. --- level_3/byte_dump/c/private-byte_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 817ab30..6980f0e 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -43,7 +43,7 @@ extern "C" { else { f_char_t skip[data->first]; - byte_get = fread(skip, sizeof(f_char_t), data->first, file.stream); + byte_get = fread(skip, 1, data->first, file.stream); } } -- 1.8.3.1