3 ms·
If len is 1 at the start, won’t this loop not execute one time? I thought predecrements are executed immediately?
by l33t2328 5y ago
If len is 1 at the start, won’t this loop not execute one time?
I thought predecrements are executed immediately?
- saagarjha 5y agoOops, 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