procinfo/procinfo-17-uptime.patch

34 lines
1.1 KiB
Diff
Raw Permalink Normal View History

--- procinfo-17/routines.c.uptime Thu Nov 16 14:21:02 2000
+++ procinfo-17/routines.c Thu Nov 16 14:30:37 2000
@@ -390,19 +390,19 @@
unsigned int d, h, m, s;
static char buf[22];
- t = t * 100 / HZ;
- d = (int) (t / 8640000);
- t = t - (long) (d * 8640000);
- h = (int) (t / 360000);
- t = t - (long) (h * 360000);
- m = (int) (t / 6000);
- t = t - (long) (m * 6000);
- s = (int) (t / 100);
- t = t - (long) (s * 100);
+ t *= (100 / HZ);
+ d = (unsigned int) (t / 8640000);
+ t -= (unsigned long) (d * 8640000);
+ h = (unsigned int) (t / 360000);
+ t -= (unsigned long) (h * 360000);
+ m = (unsigned int) (t / 6000);
+ t -= (unsigned long) (m * 6000);
+ s = (unsigned int) (t / 100);
+ t -= (unsigned long) (s * 100);
if (d > 0)
- sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (int) t);
+ sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t);
else
- sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (int) t);
+ sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t);
return buf;
}