diff --git a/Xext/security.c b/Xext/security.c index 54bd4efab..cfa52d701 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -491,7 +491,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client) authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname, stuff->nbytesAuthData, protodata, &authdata_len, &pAuthdata); - if ((XID) ~0L == authId) { + if (!authId) { return SecurityErrorBase + XSecurityBadAuthorizationProtocol; } diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c index c16e63e87..2ba592fee 100644 --- a/hw/xwin/winauth.c +++ b/hw/xwin/winauth.c @@ -68,7 +68,7 @@ winGenerateAuthorization(void) g_authId = GenerateAuthorization(strlen(AUTH_NAME), AUTH_NAME, 0, NULL, &g_uiAuthDataLen, &g_pAuthData); - if ((XID) ~0L == g_authId) { + if (!g_authId) { ErrorF("winGenerateAuthorization - GenerateAuthorization failed\n"); return FALSE; } diff --git a/os/auth.c b/os/auth.c index d79cbb8b0..28b2c6246 100644 --- a/os/auth.c +++ b/os/auth.c @@ -293,5 +293,5 @@ GenerateAuthorization(unsigned name_length, data_length_return, data_return); } } - return -1; + return 0; } diff --git a/os/mitauth.c b/os/mitauth.c index 0d960039f..867e0cb02 100644 --- a/os/mitauth.c +++ b/os/mitauth.c @@ -161,7 +161,7 @@ MitGenerateCookie(unsigned data_length, GenerateRandomData(sizeof(cookie), cookie); XID id = MitAddCookie(sizeof(cookie), cookie); if (!id) - return -1; + return 0; *data_return = cookie; *data_length_return = sizeof(cookie);