
Repair copy_frame so it copies at most announced bytes of src into dst without ever writing past cap.
copy_frame(dst, 16, "deploy", 6)ret=0 dst=[deploy]copy_frame(dst, 16, "oops", 9) // src really holds 4 bytesret=-1 dst=[oops]copy_frame(dst, 5, "frame", 5) // cap counts the terminatorret=-1 dst=[fram]copy_frame(dst, 0, "x", 1)ret=-1bounded_copy_audit.c<stddef.h>defines size_t
Run the tests to grade your code
Repair copy_frame so it copies at most announced bytes of src into dst without ever writing past cap.
copy_frame(dst, 16, "deploy", 6)ret=0 dst=[deploy]copy_frame(dst, 16, "oops", 9) // src really holds 4 bytesret=-1 dst=[oops]copy_frame(dst, 5, "frame", 5) // cap counts the terminatorret=-1 dst=[fram]copy_frame(dst, 0, "x", 1)ret=-1bounded_copy_audit.c<stddef.h>defines size_t
Run the tests to grade your code
Memory will appear here