[email protected] wrote: >I have no strong opinion. I'm fine with either approach. It's such a >silly program... > >As an aside, random -e has been completely broken (it's non-uniform) >since forever. To fix -e, we should clamp denom to an integer between >1 and 256, otherwise the truncation of the exit exit code to an 8-bit >int introduces bias for numbers larger than 256 (that aren't powers of >2).
The program is broken in multiple ways: return value clamping, casting from double to uint32_t, wrong error checking for putchar, lack of warnings when compiling. What I don't understand is why such a wrong program has its place in OpenBSD. Maybe it's historical reasons, who knows. But the fact that it exists and it's badly written bothers me.
