[libc-commits] [PATCH] D111913: [libc] add stpcpy and stpncpy

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Nov 3 00:05:42 PDT 2021


sivachandra accepted this revision.
sivachandra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/src/string/stpncpy.cpp:21
+  // Copy up until \0 is found.
+  for (i = 0; i < n && src[i] != '\0'; ++i) {
+    dest[i] = src[i];
----------------
Remove the braces around single statement `for` blocks.


================
Comment at: libc/test/src/string/stpncpy_test.cpp:22
+    ASSERT_GE(dst.size(), n);
+    // Making sure stpncpy returns dst.
+    ASSERT_EQ(__llvm_libc::stpncpy(dst.data(), src.data(), n),
----------------
Is this comment correct?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111913/new/

https://reviews.llvm.org/D111913



More information about the libc-commits mailing list