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

I tend to stay away from the entire C style strings approach in general whenever I write C.


I always use antirez's SDS string Library. The fact that they are compatible C strings with the only price to pay being a call to sdsfree() instead of free I like a lot. Simple and yet super useful. Check it out.


Strlcpy and strlcat from OpenBSD works.


IMO you should store the size of your strings. If you know the sizes already then you can just memcpy/memmove.


Only for those that never do mistakes with parameter passing.




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

Search: