From owner-freebsd-standards@FreeBSD.ORG Fri Aug 8 05:50:25 2003 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CC7137B401 for ; Fri, 8 Aug 2003 05:50:25 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF8E143F3F for ; Fri, 8 Aug 2003 05:50:24 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h78CoOUp035425 for ; Fri, 8 Aug 2003 05:50:24 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h78CoNEP035421; Fri, 8 Aug 2003 05:50:24 -0700 (PDT) Date: Fri, 8 Aug 2003 05:50:24 -0700 (PDT) Message-Id: <200308081250.h78CoNEP035421@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Oznobihin Konstantin Subject: Re: standards/55370: [patch] uuid_compare function (uuid(3)) incorrectly compares node fields. X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Oznobihin Konstantin List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2003 12:50:25 -0000 The following reply was made to PR standards/55370; it has been noted by GNATS. From: Oznobihin Konstantin To: FreeBSD-gnats-submit@FreeBSD.org Cc: Subject: Re: standards/55370: [patch] uuid_compare function (uuid(3)) incorrectly compares node fields. Date: 08 Aug 2003 12:41:54 +0000 >return (memcmp(a->node, b->node, _UUID_NODE_LEN)); Sorry, this patch isn't sufficient, because memcmp returns the difference between the first two differing bytes. Here is complete patch: --- uuid_compare.patch_2 begins here --- --- uuid_compare.c Fri Aug 8 16:18:26 2003 +++ /usr/src/lib/libc/uuid/uuid_compare.c Wed Oct 30 06:51:00 2002 @@ -72,8 +72,5 @@ res = (int)a->clock_seq_low - (int)b->clock_seq_low; if (res) return ((res < 0) ? -1 : 1); - res = memcmp(a->node, b->node, _UUID_NODE_LEN); - if (res) - return ((res < 0) ? -1 : 1); - return res; + return (memcmp(a->node, b->node, sizeof(uuid_t))); } --- uuid_compare.patch_2 ends here --- -- Konstantin Oznobihin System Programmer Computer Center of Rostov State University.