mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
Do not use GNU-specific (or BSD-specific or whatever they may be)
constants which are completely unneeded anyway. Note that 3 is a cheap integer bound for log10(1<<CHAR_BIT). Originally committed as revision 11902 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9189411bdb
commit
03c09e4399
@ -196,10 +196,9 @@ static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, int *
|
|||||||
|
|
||||||
static int udp_port(struct sockaddr_storage *addr, int addr_len)
|
static int udp_port(struct sockaddr_storage *addr, int addr_len)
|
||||||
{
|
{
|
||||||
char sbuf[NI_MAXSERV];
|
char sbuf[sizeof(int)*3+1];
|
||||||
char hbuf[NI_MAXHOST];
|
|
||||||
|
|
||||||
if (getnameinfo((struct sockaddr *)addr, addr_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
|
if (getnameinfo((struct sockaddr *)addr, addr_len, NULL, 0, sbuf, sizeof(sbuf), NI_NUMERICSERV) != 0) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "getnameinfo: %s\n", strerror(errno));
|
av_log(NULL, AV_LOG_ERROR, "getnameinfo: %s\n", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user