Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
static int FAST_FUNC
timescmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
{
- long clk_tck, s, t;
+ unsigned long clk_tck, s, t;
const unsigned char *p;
struct tms buf;
do {
t = *(clock_t *)(((char *) &buf) + p[1]);
s = t / clk_tck;
- out1fmt("%ldm%ld.%.3lds%c",
- s/60, s%60,
- ((t - s * clk_tck) * 1000) / clk_tck,
+ t = t % clk_tck;
+ out1fmt("%lum%lu.%03lus%c",
+ s / 60, s % 60,
+ (t * 1000) / clk_tck,
p[0]);
p += 2;
} while (*p);