News for hackers. Stuff that matters.
Re:Considering C99 for Curl by camel-cdr on Tuesday November 22, 2022 @10:41AM (#33706938)
I tend to stay away from the entire C style strings approach in general whenever I write C.
Re:Considering C99 for Curl by cassepipe on Tuesday November 22, 2022 @10:59AM (#33707143)
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.
Re:Considering C99 for Curl by anthk on Tuesday November 22, 2022 @11:59AM (#33707925)
Strlcpy and strlcat from OpenBSD works.
Re:Considering C99 for Curl by camel-cdr on Tuesday November 22, 2022 @12:04PM (#33708011)
IMO you should store the size of your strings. If you know the sizes already then you can just memcpy/memmove.
Re:Considering C99 for Curl by pjmlp on Tuesday November 22, 2022 @01:59PM (#33709624)
Only for those that never do mistakes with parameter passing.