Hello my name is Everett Badeaux. I just wanted to make the pull request to improve the performance and functionality of your string copy command. Can we connect?
Here are a few of the performance benefits of the new implementation:
In your implementation strncpy would continue to copy null bytes until it wrote the amount specified destination size. This is not needed. With memccpy execution will immediately stop once the null terminator is encountered. This can be a great performance benefit if the dest is exponentially larger than the src.
You also had no way of knowing if the source buffer was larger than the destination buffer. Now false will be returned if the null terminating character is not encountered otherwise true indicating successful copy.
Keeps your old implementation that if the source is not null terminated we will add at len -1 position
Hello my name is Everett Badeaux. I just wanted to make the pull request to improve the performance and functionality of your string copy command. Can we connect?
Here are a few of the performance benefits of the new implementation: