changeset 3025:41d68d056417 libavformat

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).
author rfelker
date Mon, 11 Feb 2008 03:30:42 +0000
parents 19de43025f0f
children 6acb70995546
files udp.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/udp.c	Wed Feb 06 18:57:00 2008 +0000
+++ b/udp.c	Mon Feb 11 03:30:42 2008 +0000
@@ -196,10 +196,9 @@
 
 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;
     }