mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
e99a4dcc8c
The implementations of the getproto* functions follow from the getserv* functions: same static name allocation, same type of internal function that opens a file to search, aliases are not written to the struct, same type of error handling/returns. This changes also fixes a getaddrinfo AI_PASSIVE memory error. When getaddrinfo is passed name = NULL and AI_PASSIVE in hints->ai_flags, it was setting the s_addr value to INADDR_ANY but *not* returning the addrinfo pointer via *res = ai. This caused a free(NULL) memory error when the caller tried to free res, because the caller expects res to be a valid pointer to a struct addrinfo. Our non-standard API parseport() has been updated to use strtoimax. strtoimax has an extra parameter endptr to store where the parsing was terminated. endptr is used in parseport to check if the provided string was valid. |
||
---|---|---|
.. | ||
dsp | ||
libc | ||
net | ||
tool | ||
test.mk |