C strings are hard. Speed and safety means careful accounting
 and passing around of lengths, storage sizes and reallocations.
 Stricks take care of

alcover / stricks

submited by
Style Pass
2021-06-23 11:30:08

C strings are hard. Speed and safety means careful accounting and passing around of lengths, storage sizes and reallocations. Stricks take care of all that.

The user-facing type stx_t (or strick) is just a normal char*. All the accounting, invisible to the user, is done in a prefix header :

Beware that this function is binary : exactly len bytes will be copied, NUL bytes included. If you need the stx.len property to reflect its C-string length, use stx_adjust on the result.

Leave a Comment
Related Posts