[openbsd-compat/inet_ntop.c]
     fix inet_ntop(3) prototype; ok millert@ libc to be bumbed very soon
This commit is contained in:
Damien Miller 2011-09-23 11:16:09 +10:00
parent 64efe9671d
commit 3e6fe87ef9
3 changed files with 12 additions and 9 deletions

View File

@ -15,17 +15,20 @@
Convert do {} while loop -> while {} for clarity. No binary change Convert do {} while loop -> while {} for clarity. No binary change
on most architectures. From Oliver Smith. OK deraadt@ and henning@ on most architectures. From Oliver Smith. OK deraadt@ and henning@
- tobias@cvs.openbsd.org 2007/10/21 11:09:30 - tobias@cvs.openbsd.org 2007/10/21 11:09:30
[mktemp.c] [openbsd-compat/mktemp.c]
Comment fix about time consumption of _gettemp. Comment fix about time consumption of _gettemp.
FreeBSD did this in revision 1.20. FreeBSD did this in revision 1.20.
OK deraadt@, krw@ OK deraadt@, krw@
- deraadt@cvs.openbsd.org 2008/07/22 21:47:45 - deraadt@cvs.openbsd.org 2008/07/22 21:47:45
[mktemp.c] [openbsd-compat/mktemp.c]
use arc4random_uniform(); ok djm millert use arc4random_uniform(); ok djm millert
- millert@cvs.openbsd.org 2008/08/21 16:54:44 - millert@cvs.openbsd.org 2008/08/21 16:54:44
[mktemp.c] [openbsd-compat/mktemp.c]
Remove useless code, the kernel will set errno appropriately if an Remove useless code, the kernel will set errno appropriately if an
element in the path does not exist. OK deraadt@ pvalchev@ element in the path does not exist. OK deraadt@ pvalchev@
- otto@cvs.openbsd.org 2008/12/09 19:38:38
[openbsd-compat/inet_ntop.c]
fix inet_ntop(3) prototype; ok millert@ libc to be bumbed very soon
20110922 20110922
- OpenBSD CVS Sync - OpenBSD CVS Sync

View File

@ -1,4 +1,4 @@
/* $OpenBSD: inet_ntop.c,v 1.7 2005/08/06 20:30:03 espie Exp $ */ /* $OpenBSD: inet_ntop.c,v 1.8 2008/12/09 19:38:38 otto Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium. /* Copyright (c) 1996 by Internet Software Consortium.
* *
@ -57,13 +57,13 @@ static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
* Paul Vixie, 1996. * Paul Vixie, 1996.
*/ */
const char * const char *
inet_ntop(int af, const void *src, char *dst, size_t size) inet_ntop(int af, const void *src, char *dst, socklen_t size)
{ {
switch (af) { switch (af) {
case AF_INET: case AF_INET:
return (inet_ntop4(src, dst, size)); return (inet_ntop4(src, dst, (size_t)size));
case AF_INET6: case AF_INET6:
return (inet_ntop6(src, dst, size)); return (inet_ntop6(src, dst, (size_t)size));
default: default:
errno = EAFNOSUPPORT; errno = EAFNOSUPPORT;
return (NULL); return (NULL);

View File

@ -1,4 +1,4 @@
/* $Id: openbsd-compat.h,v 1.51 2010/10/07 10:25:29 djm Exp $ */ /* $Id: openbsd-compat.h,v 1.52 2011/09/23 01:16:11 djm Exp $ */
/* /*
* Copyright (c) 1999-2003 Damien Miller. All rights reserved. * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
@ -116,7 +116,7 @@ char *inet_ntoa(struct in_addr in);
#endif #endif
#ifndef HAVE_INET_NTOP #ifndef HAVE_INET_NTOP
const char *inet_ntop(int af, const void *src, char *dst, size_t size); const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif #endif
#ifndef HAVE_INET_ATON #ifndef HAVE_INET_ATON