Fix strmhz(): avoid printing negative fractions

Signed-off-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
Wolfgang Denk 2008-10-21 15:53:51 +02:00
parent 4a7f6b750d
commit d9d8c7c696

View 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;