From 7dc5ebe06651cdf1f08e01a333deb1d330a6c63d Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Mon, 8 Dec 2008 18:41:34 +0100 Subject: [PATCH] use memcmp instead of binaryEqual suggested by Paulo Cesar Pereira de Andrade http://lists.freedesktop.org/archives/xorg/2008-December/041222.html --- src/iceauth.c | 19 +------------------ 1 files changed, 1 insertions(+), 18 deletions(-) diff --git a/src/iceauth.c b/src/iceauth.c index 6addcf8..40f1fff 100644 --- a/src/iceauth.c +++ b/src/iceauth.c @@ -38,8 +38,6 @@ Author: Ralph Mor, X Consortium #include #define Time_t time_t -static int binaryEqual (const char *a, const char *b, unsigned len); - static int was_called_state; /* @@ -213,7 +211,7 @@ _IcePaMagicCookie1Proc ( IcePaAuthStatus stat; if (authDataLen == length && - binaryEqual ((char *) authData, data, authDataLen)) + memcmp (authData, data, authDataLen) == 0) { stat = IcePaAuthAccepted; } @@ -249,18 +247,3 @@ _IcePaMagicCookie1Proc ( } IcePaAuthProc _IcePaAuthProcs[] = {_IcePaMagicCookie1Proc}; - - -/* - * local routines - */ - -static int -binaryEqual (const char *a, const char *b, unsigned len) - -{ - while (len--) - if (*a++ != *b++) - return 0; - return 1; -} -- 1.6.0.3