News for hackers. Stuff that matters.
Re:Show HN: Stricks – managed C strings library by wheybags on Thursday March 25, 2021 @07:03PM (#26586754)
If you look later on at the readme, you'll see that the stx_catf function does not reallocate, it truncates, there is another function for reallocating append.

That said, I don't really see why one would need such a no-realloc function. In c++, I would just use std::string::reserve(some_big_num).

Re:Show HN: Stricks – managed C strings library by gkfasdfasdf on Thursday March 25, 2021 @07:34PM (#26587011)
stx_new allocates the string, per the readme.

My point is that the readme example is misleading, as the two code samples are not equivalent.

Re:Show HN: Stricks – managed C strings library by alcover on Thursday March 25, 2021 @08:33PM (#26587514)
You are right, I changed it to malloc.

This 'long way' thing is definitly not super useful..