* net.cc (cygwin_inet_ntop): Change len argument to socklen_t to

follow SUSv3.
	* include/arpa/inet.h (inet_ntop): Ditto.
	* include/cygwin/in.h: Include cygwin/socket.h to get socklen_t.
This commit is contained in:
Corinna Vinschen 2005-09-17 08:55:30 +00:00
parent b3ecdcf438
commit 5da8b1281b
4 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2005-09-17 Corinna Vinschen <corinna@vinschen.de>
* net.cc (cygwin_inet_ntop): Change len argument to socklen_t to
follow SUSv3.
* include/arpa/inet.h (inet_ntop): Ditto.
* include/cygwin/in.h: Include cygwin/socket.h to get socklen_t.
2005-09-16 Christopher Faylor <cgf@timesys.com>
* environ.cc (build_env): Use "kilo"bytes not "mega"bytes. Return

View File

@ -27,7 +27,7 @@ in_addr_t inet_netof (struct in_addr);
in_addr_t inet_network (const char *);
char *inet_ntoa (struct in_addr);
int inet_pton (int, const char *, void *);
const char *inet_ntop (int, const void *, char *, size_t);
const char *inet_ntop (int, const void *, char *, socklen_t);
#endif
#ifdef __cplusplus

View File

@ -19,6 +19,7 @@
#define _CYGWIN_IN_H
#include <stdint.h>
#include <cygwin/socket.h>
/* Standard well-defined IP protocols. If you ever add one here, don't
forget to define it below. */

View File

@ -2290,7 +2290,7 @@ cygwin_inet_pton (int family, const char *strptr, void *addrptr)
/* See "UNIX Network Programming, Networing APIs: Sockets and XTI",
W. Richard Stevens, Prentice Hall PTR, 1998. */
extern "C" const char *
cygwin_inet_ntop (int family, const void *addrptr, char *strptr, size_t len)
cygwin_inet_ntop (int family, const void *addrptr, char *strptr, socklen_t len)
{
const u_char *p = (const u_char *) addrptr;
@ -2302,7 +2302,7 @@ cygwin_inet_ntop (int family, const void *addrptr, char *strptr, size_t len)
char temp[64]; /* Big enough for 4 ints ... */
__small_sprintf (temp, "%u.%u.%u.%u", p[0], p[1], p[2], p[3]);
if (strlen (temp) >= len)
if (strlen (temp) >= (size_t) len)
{
set_errno (ENOSPC);
return NULL;