Bug#194300: libc6-dev: 4th argument of inet_ntop() should have type size_t, not socklen_t
severity 194300 normal
reassign 194300 manpages-dev
thanks
At Thu, 22 May 2003 15:10:59 +0200,
Guus Sliepen wrote:
> In /usr/include/arpa/inet.h:
>
> /* Convert a Internet address in binary network format for interface
> type AF in buffer starting at CP to presentation form and place
> result in buffer of length LEN astarting at BUF. */
> extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
> char *__restrict __buf, socklen_t __len)
> __THROW;
>
> >From the manpage:
>
> SYNOPSIS
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <arpa/inet.h>
>
> const char *inet_ntop(int af, const void *src,
> char *dst, size_t cnt);
>
> The last argument, cnt, is the size of the buffer dst, so it should
> indeed have type size_t, not socklen_t. Because of this the package vic
> FTBFS on architectures where sizeof(size_t) != sizeof(socklen_t).
Manpage does not always tell the right answer. From SUSv3:
19904 SYNOPSIS
19905 #include <arpa/inet.h>
19906 const char *inet_ntop(int af, const void *restrict src,
19907 char *restrict dst, socklen_t size);
Regards,
-- gotom
Reply to: