You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accepts a pointer to a string, a pointer to a buffer, and buffer's length. Copies string to the destination. The destination address is returned if the string fits the buffer; otherwise zero is returns.
This is similar to strncpy in C. But the provided solution is the equivalent of strcpy. And because the caller in the test harness doesn't provide the buffer length in rdx an implementation that implements the behaviour described in the book will not pass the test.
The text was updated successfully, but these errors were encountered:
Thank you for reporting it, I am sorry for this inconsistency.
For now we can stay with an unsafe version with only two arguments (equivalent of strcpy) and once I submit the rest of assignments/answers I'll replace the code to match the book text.
The definition for string_copy:
This is similar to
strncpy
in C. But the provided solution is the equivalent ofstrcpy
. And because the caller in the test harness doesn't provide the buffer length inrdx
an implementation that implements the behaviour described in the book will not pass the test.The text was updated successfully, but these errors were encountered: