This is an archive of the discontinued LLVM Phabricator instance.

[libc] add strndup
ClosedPublic

Authored by michaelrj on Oct 29 2021, 1:58 PM.

Details

Summary

add an implementation of strndup

Diff Detail

Event Timeline

michaelrj created this revision.Oct 29 2021, 1:58 PM
michaelrj requested review of this revision.Oct 29 2021, 1:58 PM
sivachandra accepted this revision.Oct 29 2021, 2:59 PM

The license headers are messed up because of clang-tidy may be. But, LGTM otherwise.

libc/src/string/strndup.cpp
23

We don't need braces to enclose single statement blocks.

libc/test/src/string/strndup_test.cpp
51

Do we need this empty line here?

This revision is now accepted and ready to land.Oct 29 2021, 2:59 PM
michaelrj updated this revision to Diff 383860.Nov 1 2021, 12:47 PM
michaelrj marked 2 inline comments as done.

small formatting fixes

This revision was automatically updated to reflect the committed changes.