4 ms·
The challenge is to do it with the strn* functions. :-) String manipulation isn't that hard, and strcpy and friends aren't very good. I'm a fan of creating a
by hedora 10y ago
The challenge is to do it with the strn* functions. :-)
String manipulation isn't that hard, and strcpy and friends aren't very good. I'm a fan of creating a struct that has a uint8_t* and a length, and using that for all buffers, including strings.
Thanks for the pointer though! I'll definitely give it a careful read.
- masklinn 10y ago> I'm a fan of creating a struct that has a uint8_t* and a length, and using that for all buffers, including strings. Unsurprisingly, "record strings" are what most every language even just slightly higher-level than C does: C++, Rust, Swift, Go, …