X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_auth.c;h=ffc05154791e71899e2e20672bdebf9748344ea1;hb=818811a7ac660e46d0dca1cbf9e53ad0475af330;hp=4842d1de803652f556126a978915267a7dccb1f3;hpb=7fbfebaa3fb3a5ca2d2a307a0a5c40c015e18115;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_auth.c b/src/xcb_auth.c index 4842d1d..ffc0515 100644 --- a/src/xcb_auth.c +++ b/src/xcb_auth.c @@ -192,8 +192,8 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * /* XDM-AUTHORIZATION-1 does not handle IPv6 correctly. Do the same thing Xlib does: use all zeroes for the 4-byte address and 2-byte port number. */ - long fakeaddr = 0; - short fakeport = 0; + uint32_t fakeaddr = 0; + uint16_t fakeport = 0; APPEND(info->data, j, fakeaddr); APPEND(info->data, j, fakeport); } @@ -201,8 +201,8 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * break; case AF_UNIX: /*block*/ { - long fakeaddr = htonl(0xffffffff - next_nonce()); - short fakeport = htons(getpid()); + uint32_t fakeaddr = htonl(0xffffffff - next_nonce()); + uint16_t fakeport = htons(getpid()); APPEND(info->data, j, fakeaddr); APPEND(info->data, j, fakeport); } @@ -212,9 +212,7 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * return 0; /* do not know how to build this */ } { - long now; - time(&now); - now = htonl(now); + uint32_t now = htonl(time(0)); APPEND(info->data, j, now); } assert(j <= 192 / 8);