mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
fix for bug 1328444?
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@353 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
177c618ba5
commit
e58168e6ae
@ -2504,12 +2504,12 @@ static void generate_text()
|
|||||||
OBJ(memperc) {
|
OBJ(memperc) {
|
||||||
if (cur->memmax) {
|
if (cur->memmax) {
|
||||||
if (!use_spacer)
|
if (!use_spacer)
|
||||||
snprintf(p, n, "%*d",
|
snprintf(p, n, "%*lu",
|
||||||
pad_percents,
|
pad_percents,
|
||||||
(cur->mem * 100) /
|
(cur->mem * 100) /
|
||||||
(cur->memmax));
|
(cur->memmax));
|
||||||
else
|
else
|
||||||
snprintf(p, 4, "%*d ",
|
snprintf(p, 4, "%*lu ",
|
||||||
pad_percents,
|
pad_percents,
|
||||||
(cur->mem * 100) /
|
(cur->mem * 100) /
|
||||||
(cur->memmax));
|
(cur->memmax));
|
||||||
@ -2658,13 +2658,13 @@ static void generate_text()
|
|||||||
strncpy(p, "No swap", 255);
|
strncpy(p, "No swap", 255);
|
||||||
} else {
|
} else {
|
||||||
if (!use_spacer)
|
if (!use_spacer)
|
||||||
snprintf(p, 255, "%*u",
|
snprintf(p, 255, "%*lu",
|
||||||
pad_percents,
|
pad_percents,
|
||||||
(cur->swap *
|
(cur->swap *
|
||||||
100) /
|
100) /
|
||||||
cur->swapmax);
|
cur->swapmax);
|
||||||
else
|
else
|
||||||
snprintf(p, 4, "%*u ",
|
snprintf(p, 4, "%*lu ",
|
||||||
pad_percents,
|
pad_percents,
|
||||||
(cur->swap *
|
(cur->swap *
|
||||||
100) /
|
100) /
|
||||||
|
@ -159,8 +159,8 @@ struct information {
|
|||||||
double uptime;
|
double uptime;
|
||||||
|
|
||||||
/* memory information in kilobytes */
|
/* memory information in kilobytes */
|
||||||
unsigned int mem, memmax, swap, swapmax;
|
unsigned long mem, memmax, swap, swapmax;
|
||||||
unsigned int bufmem, buffers, cached;
|
unsigned long bufmem, buffers, cached;
|
||||||
|
|
||||||
unsigned int procs;
|
unsigned int procs;
|
||||||
unsigned int run_procs;
|
unsigned int run_procs;
|
||||||
|
12
src/linux.c
12
src/linux.c
@ -109,17 +109,17 @@ void update_meminfo()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (strncmp(buf, "MemTotal:", 9) == 0) {
|
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) {
|
} 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) {
|
} 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) {
|
} 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) {
|
} 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) {
|
} else if (strncmp(buf, "Cached:", 7) == 0) {
|
||||||
sscanf(buf, "%*s %u", &info.cached);
|
sscanf(buf, "%*s %lu", &info.cached);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user