SocketOpenCOTSServer: handle -Wconditional-uninitialized warning

Clears warning from clang 13:

.../include/X11/Xtrans/Xtranssock.c:670:14: warning: variable 'ciptr'
 may be uninitialized when used here [-Wconditional-uninitialized]
        setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEADDR,
                    ^~~~~
.../include/X11/Xtrans/Xtranssock.c:624:25: note: initialize the
 variable 'ciptr' to silence this warning
    XtransConnInfo      ciptr;
                             ^
                              = NULL

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxtrans/-/merge_requests/26>
This commit is contained in:
Alan Coopersmith
2024-11-16 16:37:06 -08:00
parent 3fc4f55eb3
commit e58ae2d27f

View File

@@ -621,7 +621,7 @@ TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol,
const char *host, const char *port)
{
XtransConnInfo ciptr;
XtransConnInfo ciptr = NULL;
int i = -1;
prmsg (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);