Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For C: strncpy(), strncat(), snprintf() (or the non-standard asprintf()), and fgets(), respectively. I believe pickle is a Python thing.


The sa[fn]e alternative to pickling your objects is to write your data into a well defined file format and read it back with stringent input checks.


It's worth noting that strncpy doesn't always null-terminate strings (on some platforms), so strlcpy is preferable.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: