The ups and downs of strlcpy()
Posted Jul 19, 2012 11:29 UTC (Thu) by cladisch
(✭ supporter ✭
In reply to: The ups and downs of strlcpy()
Parent article: The ups and downs of strlcpy()
x86 has several string instructions that essentially implement mem* functions: rep movs for memcpy(), repne scas for memchr(), rep stos for memset(), and repe cmps for memcmp().
As far as I can see, strcpy(), strncpy(), and strlcpy() could be implemented equally well on top of these primitives.
to post comments)