From: Wolfgang Denk Date: Tue, 21 Oct 2008 13:53:51 +0000 (+0200) Subject: Fix strmhz(): avoid printing negative fractions X-Git-Tag: v2009.01-rc1~139 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d9d8c7c696dec370ca714c03beb6e79d4c90bd5e;p=u-boot Fix strmhz(): avoid printing negative fractions Signed-off-by: Wolfgang Denk --- diff --git a/lib_generic/strmhz.c b/lib_generic/strmhz.c index 342cf2b212..d6da1d136e 100644 --- a/lib_generic/strmhz.c +++ b/lib_generic/strmhz.c @@ -27,7 +27,7 @@ char *strmhz (char *buf, long hz) long l, n; long m; - n = DIV_ROUND(hz, 1000000L); + n = DIV_ROUND(hz, 1000) / 1000L; l = sprintf (buf, "%ld", n); hz -= n * 1000000L;