projects
/
fll
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff8a46d
)
Update: Do not use sizeof(char_t) for explicitly handling 1 byte.
author
Kevin Day
<thekevinday@gmail.com>
Sat, 2 Apr 2022 13:41:07 +0000
(08:41 -0500)
committer
Kevin Day
<thekevinday@gmail.com>
Sat, 2 Apr 2022 13:41:07 +0000
(08:41 -0500)
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
patch
|
blob
|
history
diff --git
a/level_3/byte_dump/c/private-byte_dump.c
b/level_3/byte_dump/c/private-byte_dump.c
index 817ab30526eb2606c8776302bb7710d288ff4904..6980f0eb6b985d632559f83b429a176ab4bb2c78 100644
(file)
--- 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);
}
}