Subject: Re: kern/36615: acpitz(4) prints "-273.-3C"
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 07/08/2007 10:55:02
The following reply was made to PR kern/36615; it has been noted by GNATS.
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/36615: acpitz(4) prints "-273.-3C"
Date: Sun, 8 Jul 2007 11:53:11 +0100
On Sun, Jul 08, 2007 at 10:20:00AM +0000, Tetsuya Isaki wrote:
> >Number: 36615
> >Synopsis: acpitz(4) prints "-273.-3C"
>
> - snprintf(buf, sizeof(buf), "%d.%d", (dk - ATZ_ZEROC) / 10,
> - (dk - ATZ_ZEROC) % 10);
> + dc = dk - ATZ_ZEROC;
> + snprintf(buf, sizeof(buf), "%d.%d", dc / 10, abs(dc) % 10);
That still gets the result wrong for -ve values.
David
--
David Laight: david@l8s.co.uk