bstring
Fewer than 5 people recommend it so far, so there's no written verdict. Here is what commenters said.
3recommend
0warn against
Dec 30, 2025first mention
Dec 30, 2025latest mention
Why people recommend it
“After years I now think it's essential to have a library which records at least how much memory”
Caveats and dissent
No one in these comments warned against it.
Threads where it came up
- No strcpy either 3 mentions
Data: bstring.json. Quotes are verbatim; the verdict and theme labels are written by a model from these comments, and every clause links to its sources.
All comments 3
> I've always wondered at the motivatons of the various string routines in C This idiom: char hostname[20]; ... strncpy( hostname, input, 20 ); hostname[19]=0; exists because strncpy was invented for copying file names that got stored in 14-byte arrays, zero terminated only if space permitted (https://stackoverflow.com/a/1454071)
strncpy is fairly easy, that's a special-purpose function for copying a C string into a fixed-width string, like typically used in old C applications for on-disk formats. E.g. you might have a char username[20] field which can contain up to 20 characters, with unused characters filled with NULs. That's what strncpy is for. The destination argument should always be a fixed-size char array. A couple years ago we got a
“After years I now think it's essential to have a library which records at least how much memory”