Re:The time the x86 emulator team found code so bad they fix...
by chadgpt3 on Tuesday June 16, 2026 @06:11AM
(#48553003)
Why does your fread to anything other than multiplying the two arguments?
[ Parent
| on HN ]
Re:The time the x86 emulator team found code so bad they fix...
by Sesse__ on Tuesday June 16, 2026 @07:20AM
(#48553499)
The idea of having two arguments to fread() is presumably to be able to do something else than all-or-nothing when there's a short read.
Re:The time the x86 emulator team found code so bad they fix...
by chadgpt3 on Tuesday June 16, 2026 @07:58AM
(#48553846)
Yes, it divides the bytes read by the element size to get the return value.
Which is the obvious reason you'd pass an element size of 1: you want to know how many bytes were read.