[libc-commits] [PATCH] D112846: [libc] add strndup
    Siva Chandra via Phabricator via libc-commits 
    libc-commits at lists.llvm.org
       
    Fri Oct 29 14:59:36 PDT 2021
    
    
  
sivachandra accepted this revision.
sivachandra added a comment.
This revision is now accepted and ready to land.
The license headers are messed up because of clang-tidy may be. But, LGTM otherwise.
================
Comment at: libc/src/string/strndup.cpp:22
+LLVM_LIBC_FUNCTION(char *, strndup, (const char *src, size_t size)) {
+  if (src == nullptr) {
+    return nullptr;
----------------
We don't need braces to enclose single statement blocks.
================
Comment at: libc/test/src/string/strndup_test.cpp:50
+TEST(LlvmLibcstrndupTest, NullPtr) {
+
+  char *result = __llvm_libc::strndup(nullptr, 0);
----------------
Do we need this empty line here?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112846/new/
https://reviews.llvm.org/D112846
    
    
More information about the libc-commits
mailing list