HNHacker News
TopNewBestAskShowJobs

csmachines

13 karma · joined April 13, 2025

submissionscomments
csmachines··on Show HN: I made a zero dependency Bitcoin math implementation in C
I'm 100% human, but also 100% amateur. Until 5 minutes ago, I understood <ctype h> to be necessary for me to use typedef to enable me to refer to structs by an alias, instead of writing "struct"! The perils of being self-taught. Now I can see the only errors thrown up when I remove the include are isdigit and isalnum! This is why I posted on HN!

EDIT: I think I can fix the isalnum bug risk that you identified by checking that the value of the ch variable in the get_string_input function is non-negative before allowing it to be appended to str.

csmachines··on Show HN: I made a zero dependency Bitcoin math implementation in C
Thanks, this is the kind of feedback my hobbyist ass needs. My intention in including <ctype h> is solely to allow me to define structs using typdef. I'm not aware of any crashes or compiler warnings caused by the potential abuse, but I'm going to look at it later.
csmachines··on Show HN: I made a zero dependency Bitcoin math implementation in C
You're right. I should have said no dependencies other than standard C libraries. I meant no big ones like SSL, GMP, etc.