Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
saagarjha
on June 20, 2021
|
parent
|
context
|
favorite
| on:
Designing a better strcpy
Oops, yes, I forgot to add the "-1" to the end of that. The blog post has the right invariant:
> this function will copy the smaller of strlen(src) or len - 1 bytes from src to dst
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
> this function will copy the smaller of strlen(src) or len - 1 bytes from src to dst