Revision 03c09e43 libavformat/udp.c

View differences:

libavformat/udp.c
196 196

  
197 197
static int udp_port(struct sockaddr_storage *addr, int addr_len)
198 198
{
199
    char sbuf[NI_MAXSERV];
200
    char hbuf[NI_MAXHOST];
199
    char sbuf[sizeof(int)*3+1];
201 200

  
202
    if (getnameinfo((struct sockaddr *)addr, addr_len, hbuf, sizeof(hbuf),  sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
201
    if (getnameinfo((struct sockaddr *)addr, addr_len, NULL, 0,  sbuf, sizeof(sbuf), NI_NUMERICSERV) != 0) {
203 202
        av_log(NULL, AV_LOG_ERROR, "getnameinfo: %s\n", strerror(errno));
204 203
        return -1;
205 204
    }

Also available in: Unified diff