[PATCH: libXdmcp 2/4] XdmcpARRAY8Equal: Use memcmp instead of rolling our own

Alan Coopersmith alan.coopersmith at oracle.com
Wed May 5 12:47:41 PDT 2010


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 A8Eq.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/A8Eq.c b/A8Eq.c
index 241d953..cf833d1 100644
--- a/A8Eq.c
+++ b/A8Eq.c
@@ -38,12 +38,9 @@ in this Software without prior written authorization from The Open Group.
 int
 XdmcpARRAY8Equal (const ARRAY8Ptr array1, const ARRAY8Ptr array2)
 {
-    int	i;
-
     if (array1->length != array2->length)
 	return FALSE;
-    for (i = 0; i < (int)array1->length; i++)
-	if (array1->data[i] != array2->data[i])
-	    return FALSE;
+    if (memcmp(array1->data, array2->data, array1->length) != 0)
+	return FALSE;
     return TRUE;
 }
-- 
1.5.6.5



More information about the xorg-devel mailing list