This is an archive of the discontinued LLVM Phabricator instance.

[libc] add memccpy and mempcpy
ClosedPublic

Authored by michaelrj on Oct 13 2021, 4:04 PM.

Details

Summary

Add an implementation for memccpy and mempcpy. These functions are
posix extensions for the moment.

Diff Detail

Event Timeline

michaelrj created this revision.Oct 13 2021, 4:04 PM
michaelrj requested review of this revision.Oct 13 2021, 4:04 PM
lntue added inline comments.Oct 14 2021, 6:39 AM
libc/src/string/memccpy.cpp
18

dest and src are void*

30

nullptr is returned when c is not found,

libc/src/string/memccpy.h
17

dest and src should be void*

libc/src/string/mempcpy.h
17

dest and src should be void*

michaelrj updated this revision to Diff 379839.Oct 14 2021, 2:14 PM
michaelrj marked 4 inline comments as done.

fix memccpy implementation to return correctly

lntue accepted this revision.Oct 14 2021, 4:28 PM
This revision is now accepted and ready to land.Oct 14 2021, 4:28 PM
This revision was automatically updated to reflect the committed changes.