Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2002 15:26:54 +0300
From:      "Andrey A. Chernov" <ache@nagual.pp.ru>
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>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021213122654.GA32014>