[libc-commits] [libc] [libc] Expand usage of libc null checks. (PR #116262)

via libc-commits libc-commits at lists.llvm.org
Sat May 31 10:36:52 PDT 2025


================
@@ -17,6 +18,8 @@ namespace LIBC_NAMESPACE_DECL {
 LLVM_LIBC_FUNCTION(char *, stpncpy,
                    (char *__restrict dest, const char *__restrict src,
                     size_t n)) {
+  LIBC_CRASH_ON_NULLPTR(dest);
----------------
lntue wrote:

Do we need to check if `n != 0` before checking `nullptr`?

https://github.com/llvm/llvm-project/pull/116262


More information about the libc-commits mailing list