1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Fix printing of integer Kelvins broken in rev. 1.71, which is

fatal on sizeof(int) != sizeof(long) systems (such as amd64).

MFC after:	1 day
This commit is contained in:
Ruslan Ermilov 2006-08-15 13:32:39 +00:00
parent adfa0adec0
commit e556ec911a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161313

View File

@ -584,11 +584,11 @@ show_var(int *oid, int nlen)
printf(hflag ? "%'#010x" : "%#010x",
*(unsigned int *)p);
else if (*fmt == 'K') {
if (*(long *)p < 0)
printf("%ld", *(long *)p);
if (*(int *)p < 0)
printf("%d", *(int *)p);
else
printf("%.1fC",
(*(long *)p - 2732.0) / 10);
(*(int *)p - 2732.0) / 10);
} else
printf(hflag ? "%'d" : "%d", *(int *)p);
val = " ";