static char *addr_to_string(const char *format,

                            struct sockaddr_storage *sa,

                            socklen_t salen) {

    char *addr;

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    int err;



    if ((err = getnameinfo((struct sockaddr *)sa, salen,

                           host, sizeof(host),

                           serv, sizeof(serv),

                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

        VNC_DEBUG("Cannot resolve address %d: %s\n",

                  err, gai_strerror(err));

        return NULL;

    }



    if (asprintf(&addr, format, host, serv) < 0)

        return NULL;



    return addr;

}

static char *addr_to_string(const char *format,

                            struct sockaddr_storage *sa,

                            socklen_t salen) {

    char *addr;

    char host[NI_MAXHOST];

    char serv[NI_MAXSERV];

    int err;



    if ((err = getnameinfo((struct sockaddr *)sa, salen,

                           host, sizeof(host),

                           serv, sizeof(serv),

                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

        VNC_DEBUG("Cannot resolve address %d: %s\n",

                  err, gai_strerror(err));

        return NULL;

    }



    if (asprintf(&addr, format, host, serv) < 0)

        return NULL;



    return addr;

}

static char *FUNC_0(const char *VAR_0,

                            struct sockaddr_storage *VAR_1,

                            socklen_t VAR_2) {

    char *VAR_3;

    char VAR_4[NI_MAXHOST];

    char VAR_5[NI_MAXSERV];

    int VAR_6;



    if ((VAR_6 = getnameinfo((struct sockaddr *)VAR_1, VAR_2,

                           VAR_4, sizeof(VAR_4),

                           VAR_5, sizeof(VAR_5),

                           NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {

        VNC_DEBUG("Cannot resolve address %d: %s\n",

                  VAR_6, gai_strerror(VAR_6));

        return NULL;

    }



    if (asprintf(&VAR_3, VAR_0, VAR_4, VAR_5) < 0)

        return NULL;



    return VAR_3;

}

static char *FUNC_0(const char *VAR_0,
struct sockaddr_storage *VAR_1,
socklen_t VAR_2) { char *VAR_3; char VAR_4[NI_MAXHOST]; char VAR_5[NI_MAXSERV]; int VAR_6; if ((VAR_6 = getnameinfo((struct sockaddr *)VAR_1, VAR_2,
VAR_4, sizeof(VAR_4),
VAR_5, sizeof(VAR_5),
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) { VNC_DEBUG("Cannot resolve address %d: %s\n",
VAR_6, gai_strerror(VAR_6)); return NULL; } if (asprintf(&VAR_3, VAR_0, VAR_4, VAR_5) < 0)
return NULL; return VAR_3; }