From owner-freebsd-current Fri Dec 13 4:27: 4 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82F0937B401; Fri, 13 Dec 2002 04:27:03 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9BC543EC2; Fri, 13 Dec 2002 04:27:01 -0800 (PST) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.6/8.12.6) with ESMTP id gBDCQsHE032064; Fri, 13 Dec 2002 15:26:55 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.6/8.12.6/Submit) id gBDCQsFk032063; Fri, 13 Dec 2002 15:26:54 +0300 (MSK) (envelope-from ache) Date: Fri, 13 Dec 2002 15:26:54 +0300 From: "Andrey A. Chernov" To: ru@freebsd.org, bwk@bell-labs.com, obrien@freebsd.org Cc: current@freebsd.org Subject: New AWK bug with collating Message-ID: <20021213122654.GA32014@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Since both operands are unsigned, result can't be negative, but supposed to be. Here is the fix: --- b.c.bak Fri Dec 13 14:54:12 2002 +++ b.c Fri Dec 13 15:20:15 2002 @@ -292,7 +292,7 @@ s[0][0] = a; s[1][0] = b; if ((r = strcoll(s[0], s[1])) == 0) - r = (uschar)a - (uschar)b; + r = (int)((uschar)a) - (int)((uschar)b); return r; } -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message