diff options
author | ru <ru@FreeBSD.org> | 2006-08-15 13:32:39 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-08-15 13:32:39 +0000 |
commit | a6794a47d1fa3d5d3258d361190fabcb77196988 (patch) | |
tree | 3b7d0cf3f7caa964f863ff4efbccaa7f9b053a8a /sbin/sysctl | |
parent | eb91ee0f35d84b6103c7b3e9bec6a6f2e2652279 (diff) | |
download | FreeBSD-src-a6794a47d1fa3d5d3258d361190fabcb77196988.zip FreeBSD-src-a6794a47d1fa3d5d3258d361190fabcb77196988.tar.gz |
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
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index d171ec9..1c5fc9d 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -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 = " "; |