Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
nathell
· 12y ago · 0 comments
For C: strncpy(), strncat(), snprintf() (or the non-standard asprintf()), and fgets(), respectively. I believe pickle is a Python thing.
Comments
[–]
sdfjkl
12y ago
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.
[–]
rainforest
12y ago
It's worth noting that strncpy doesn't always null-terminate strings (on some platforms), so strlcpy is preferable.