OBJ(memperc) {
if (cur->memmax) {
if (!use_spacer)
- snprintf(p, n, "%*d",
+ snprintf(p, n, "%*lu",
pad_percents,
(cur->mem * 100) /
(cur->memmax));
else
- snprintf(p, 4, "%*d ",
+ snprintf(p, 4, "%*lu ",
pad_percents,
(cur->mem * 100) /
(cur->memmax));
strncpy(p, "No swap", 255);
} else {
if (!use_spacer)
- snprintf(p, 255, "%*u",
+ snprintf(p, 255, "%*lu",
pad_percents,
(cur->swap *
100) /
cur->swapmax);
else
- snprintf(p, 4, "%*u ",
+ snprintf(p, 4, "%*lu ",
pad_percents,
(cur->swap *
100) /
double uptime;
/* memory information in kilobytes */
- unsigned int mem, memmax, swap, swapmax;
- unsigned int bufmem, buffers, cached;
+ unsigned long mem, memmax, swap, swapmax;
+ unsigned long bufmem, buffers, cached;
unsigned int procs;
unsigned int run_procs;
break;
if (strncmp(buf, "MemTotal:", 9) == 0) {
- sscanf(buf, "%*s %u", &info.memmax);
+ sscanf(buf, "%*s %lu", &info.memmax);
} else if (strncmp(buf, "MemFree:", 8) == 0) {
- sscanf(buf, "%*s %u", &info.mem);
+ sscanf(buf, "%*s %lu", &info.mem);
} else if (strncmp(buf, "SwapTotal:", 10) == 0) {
- sscanf(buf, "%*s %u", &info.swapmax);
+ sscanf(buf, "%*s %lu", &info.swapmax);
} else if (strncmp(buf, "SwapFree:", 9) == 0) {
- sscanf(buf, "%*s %u", &info.swap);
+ sscanf(buf, "%*s %lu", &info.swap);
} else if (strncmp(buf, "Buffers:", 8) == 0) {
- sscanf(buf, "%*s %u", &info.buffers);
+ sscanf(buf, "%*s %lu", &info.buffers);
} else if (strncmp(buf, "Cached:", 7) == 0) {
- sscanf(buf, "%*s %u", &info.cached);
+ sscanf(buf, "%*s %lu", &info.cached);
}
}