Better HN
topnewbestaskshowjobs
Log inSign up

csmachines

13 karma · joined Apr 13, 2025 (1y ago) · 6 submissions

Submissions

comment 1y ago · link · parent

Great, thanks for the advice. I'll include this in the weekend's updates.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

You're right. I should have said no dependencies other than standard C libraries. I meant no big ones like SSL, GMP, etc.

5.

Show HN: I made a zero dependency Bitcoin math implementation in C(github.com ↗)

26 points · by csmachines · 1y ago · 15 comments