Fix strmhz(): avoid printing negative fractions
authorWolfgang Denk <wd@denx.de>
Tue, 21 Oct 2008 13:53:51 +0000 (15:53 +0200)
committerWolfgang Denk <wd@denx.de>
Wed, 22 Oct 2008 06:52:19 +0000 (08:52 +0200)
Signed-off-by: Wolfgang Denk <wd@denx.de>
lib_generic/strmhz.c

index 342cf2b21269bf3b3b0cde9cfc0795b7d5440136..d6da1d136eef49c4207127672e0c577f74ae8f47 100644 (file)
@@ -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;