diff options
author | D Richard Felker III <dalias@aerifal.cx> | 2008-02-11 03:30:42 +0000 |
---|---|---|
committer | D Richard Felker III <dalias@aerifal.cx> | 2008-02-11 03:30:42 +0000 |
commit | 03c09e43993a7c8e4db7930a0e6be736457af494 (patch) | |
tree | ac96bc1681d657ee1f5042f7890cc2c411bc7701 /libavformat | |
parent | 9189411bdb3e7137ee9aeed38ce56715b487836c (diff) | |
download | ffmpeg-03c09e43993a7c8e4db7930a0e6be736457af494.tar.gz |
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
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/udp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c index d5a48be3fa..da3e253820 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -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) { - char sbuf[NI_MAXSERV]; - char hbuf[NI_MAXHOST]; + char sbuf[sizeof(int)*3+1]; - 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)); return -1; } |