Clarifying further for the devs dealing first time with str
structure: the functions working with them do not change the content of the input value, it sets (shifts) the start pointer str.s
and adjusts the length str.len
.
Also, in many cases the str.s does not point to a zero-terminated string value of length str.len, that's why printing it in logs must be done with %.*s
which requires first to provide the lenght. There are acases when str.s points to a zero-terminated string, but the developer has to track the origin of the value and be sure it is zero-terminated.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.