From 53dbd78ae08969e119488997fedec56f17abf4e0 Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Thu, 11 May 2023 22:56:18 +0000 Subject: [PATCH] Nullability check for inet module. Bugs: b/245972273 Test: adb shell Change-Id: I51830ddbf5ceb7c02154bd335feb65ca1a230b66 --- libc/include/arpa/inet.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h index db054c9e1..748b7a14e 100644 --- a/libc/include/arpa/inet.h +++ b/libc/include/arpa/inet.h @@ -36,17 +36,17 @@ __BEGIN_DECLS -in_addr_t inet_addr(const char* __s); -int inet_aton(const char* __s, struct in_addr* __addr); +in_addr_t inet_addr(const char* _Nonnull __s); +int inet_aton(const char* _Nonnull __s, struct in_addr* _Nullable __addr); in_addr_t inet_lnaof(struct in_addr __addr) __INTRODUCED_IN(21); struct in_addr inet_makeaddr(in_addr_t __net, in_addr_t __host) __INTRODUCED_IN(21); in_addr_t inet_netof(struct in_addr __addr) __INTRODUCED_IN(21); -in_addr_t inet_network(const char* __s) __INTRODUCED_IN(21); -char* inet_ntoa(struct in_addr __addr); -const char* inet_ntop(int __af, const void* __src, char* __dst, socklen_t __size); -unsigned int inet_nsap_addr(const char* __ascii, unsigned char* __binary, int __n); -char* inet_nsap_ntoa(int __binary_length, const unsigned char* __binary, char* __ascii); -int inet_pton(int __af, const char* __src, void* __dst); +in_addr_t inet_network(const char* _Nonnull __s) __INTRODUCED_IN(21); +char* _Nonnull inet_ntoa(struct in_addr __addr); +const char* _Nullable inet_ntop(int __af, const void* _Nonnull __src, char* _Nonnull __dst, socklen_t __size); +unsigned int inet_nsap_addr(const char* _Nonnull __ascii, unsigned char* _Nonnull __binary, int __n); +char* _Nonnull inet_nsap_ntoa(int __binary_length, const unsigned char* _Nonnull __binary, char* _Nullable __ascii); +int inet_pton(int __af, const char* _Nonnull __src, void* _Nonnull __dst); __END_DECLS