Hacker News new | ask | show | jobs
by zbuf 1060 days ago
Interesting to see the implementation is basically a two-pass process: strlen() to count the source string, followed by a memcpy().

My intuition would be to give some importance to not looping on the source string radically beyond the length of the destination buffer.

https://sourceware.org/git/?p=glibc.git;a=blob;f=string/strl...