summaryrefslogtreecommitdiff
path: root/libc/src/string/strcoll_l.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/string/strcoll_l.cpp')
-rw-r--r--libc/src/string/strcoll_l.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/src/string/strcoll_l.cpp b/libc/src/string/strcoll_l.cpp
index f664a3c7c03f..e820efa564a3 100644
--- a/libc/src/string/strcoll_l.cpp
+++ b/libc/src/string/strcoll_l.cpp
@@ -10,12 +10,15 @@
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
+#include "src/__support/macros/null_check.h"
namespace LIBC_NAMESPACE_DECL {
// TODO: Add support for locales.
LLVM_LIBC_FUNCTION(int, strcoll_l,
(const char *left, const char *right, locale_t)) {
+ LIBC_CRASH_ON_NULLPTR(left);
+ LIBC_CRASH_ON_NULLPTR(right);
for (; *left && *left == *right; ++left, ++right)
;
return static_cast<int>(*left) - static_cast<int>(*right);