Your mission
Write copy_capped, which copies src into dst, a buffer of cap bytes, never writes past the end of that buffer, and returns the length of src.
See it in action
copy_capped(dst, "git", 16)[git] ret=3 guard=intactcopy_capped(dst, "rebase", 4)[reb] ret=6 guard=intactcopy_capped(dst, "zsh", 0)ret=3 guard=intact
Your checklist
Constraints
- Expected file
copy_capped.c- Allowed functions
- None. Write every helper yourself.
- Allowed headers
<stddef.h>defines size_t
