Ushering out strlcpy()
So why insist on this NUL termination business? I expected this to be necessary in C libraries due to legacy code but the kernel can always do whatever it wants internally.<p><pre><code>  struct bytes { size_t size; unsigned char *pointer; };
</code></pre>
Seems simple enough... A little structure like that has always been useful in my projects.<p>I find myself agreeing with the glibc maintainer in the extended discussion linked from the article:<p><a href="https://lwn.net/Articles/612244/" rel="nofollow">https://lwn.net/Articles/612244/</a><p>> Correct string handling means that you always know how long your strings are and therefore you can you memcpy (instead of strcpy).<p>I think he's absolutely right. The str* functions are just worse versions of the mem* functions.