From: Kevin Day Date: Sat, 2 Apr 2022 13:41:07 +0000 (-0500) Subject: Update: Do not use sizeof(char_t) for explicitly handling 1 byte. X-Git-Tag: 0.5.9~6 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=46b31f3864e19ab09dc3b85e479371e5192ceabf;p=fll 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. --- 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); } }