Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Apr 2010 14:34:44 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206842 - head/contrib/top
Message-ID:  <201004191434.o3JEYih5027972@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Mon Apr 19 14:34:44 2010
New Revision: 206842
URL: http://svn.freebsd.org/changeset/base/206842

Log:
  Fix brokenness in top on big-endian 32-bit systems introduced when
  changing format_k2 to take a long long. Because itoa is defined as a K&R
  C function, without prototyping its arguments, format_k2 passed a 64-bit
  value, but itoa() received only the first word, showing '0' in all memory
  fields.

Modified:
  head/contrib/top/utils.c

Modified: head/contrib/top/utils.c
==============================================================================
--- head/contrib/top/utils.c	Mon Apr 19 14:23:15 2010	(r206841)
+++ head/contrib/top/utils.c	Mon Apr 19 14:34:44 2010	(r206842)
@@ -499,7 +499,7 @@ unsigned long long amt;
 	}
     }
 
-    p = strecpy(p, itoa(amt));
+    p = strecpy(p, itoa((int)amt));
     *p++ = tag;
     *p = '\0';
 



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