From 88f4b1a95746d98a23f37372e2144242bb247c5b Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Thu, 27 Apr 2023 18:03:38 +0000 Subject: [PATCH] Nullability check for strcasecmp module. Bugs: b/245972273 Test: adb shell Change-Id: Ic6322e957cccd827fe437a4a3dd2848036913f29 --- libc/include/bits/strcasecmp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/include/bits/strcasecmp.h b/libc/include/bits/strcasecmp.h index 3994b6893..23acbe51a 100644 --- a/libc/include/bits/strcasecmp.h +++ b/libc/include/bits/strcasecmp.h @@ -46,12 +46,12 @@ __BEGIN_DECLS * Returns an integer less than, equal to, or greater than zero if the first string is less than, * equal to, or greater than the second string (ignoring case). */ -int strcasecmp(const char* __s1, const char* __s2) __attribute_pure__; +int strcasecmp(const char* _Nonnull __s1, const char* _Nonnull __s2) __attribute_pure__; /** * Like strcasecmp() but taking a `locale_t`. */ -int strcasecmp_l(const char* __s1, const char* __s2, locale_t __l) __attribute_pure__ __INTRODUCED_IN(23); +int strcasecmp_l(const char* _Nonnull __s1, const char* _Nonnull __s2, locale_t _Nonnull __l) __attribute_pure__ __INTRODUCED_IN(23); /** * [strncasecmp(3)](http://man7.org/linux/man-pages/man3/strncasecmp.3.html) compares the first @@ -61,11 +61,11 @@ int strcasecmp_l(const char* __s1, const char* __s2, locale_t __l) __attribute_p * first string is less than, equal to, or greater than the first `n` bytes of the second * string (ignoring case). */ -int strncasecmp(const char* __s1, const char* __s2, size_t __n) __attribute_pure__; +int strncasecmp(const char* _Nonnull __s1, const char* _Nonnull __s2, size_t __n) __attribute_pure__; /** * Like strncasecmp() but taking a `locale_t`. */ -int strncasecmp_l(const char* __s1, const char* __s2, size_t __n, locale_t __l) __attribute_pure__ __INTRODUCED_IN(23); +int strncasecmp_l(const char* _Nonnull __s1, const char* _Nonnull __s2, size_t __n, locale_t _Nonnull __l) __attribute_pure__ __INTRODUCED_IN(23); __END_DECLS