Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment 2.7 string_copy definition doesn't match test harness or solution code #17

Closed
jackc opened this issue Aug 2, 2017 · 2 comments
Assignees

Comments

@jackc
Copy link

jackc commented Aug 2, 2017

The definition for string_copy:

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.

@sayon sayon self-assigned this Aug 3, 2017
@sayon
Copy link
Collaborator

sayon commented Aug 3, 2017

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.

@sayon
Copy link
Collaborator

sayon commented Jan 12, 2018

fixed in #57

@sayon sayon closed this as completed Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants