Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by zbuf

2 years 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...

0 comments

zbuf

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities