Browse Source

Fix strmhz(): avoid printing negative fractions

Signed-off-by: Wolfgang Denk <wd@denx.de>
Wolfgang Denk 15 years ago
parent
commit
d9d8c7c696
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib_generic/strmhz.c

+ 1 - 1
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;