Repair this code
Repair copy_frame so it copies at most announced bytes of src into dst, never writes past cap, and treats announced as a claim from the caller instead of a fact.
Steps
$ copy_frame(dst, 16, "deploy", 6)
ret=0 dst=[deploy]
$ copy_frame(dst, 16, "oops", 9) // src really holds 4 bytes
ret=-1 dst=[oops]
$ copy_frame(dst, 5, "frame", 5) // cap counts the terminator
ret=-1 dst=[fram]
$ copy_frame(dst, 0, "x", 1)
ret=-1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Repair this code
Repair copy_frame so it copies at most announced bytes of src into dst, never writes past cap, and treats announced as a claim from the caller instead of a fact.
Steps
$ copy_frame(dst, 16, "deploy", 6)
ret=0 dst=[deploy]
$ copy_frame(dst, 16, "oops", 9) // src really holds 4 bytes
ret=-1 dst=[oops]
$ copy_frame(dst, 5, "frame", 5) // cap counts the terminator
ret=-1 dst=[fram]
$ copy_frame(dst, 0, "x", 1)
ret=-1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Tests
Run the tests to grade your code