mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 17:01:15 +02:00
2 supplement to 1f0a1bfdf2
This commit is contained in:
@@ -860,12 +860,12 @@ static size_t getCachedMemSize(void)
|
|||||||
size_t cached = 0;
|
size_t cached = 0;
|
||||||
if (procmeminfo) {
|
if (procmeminfo) {
|
||||||
char buf[80] = {0}, a[80] = {0};
|
char buf[80] = {0}, a[80] = {0};
|
||||||
long long unsigned int v = 0;
|
size_t v = 0;
|
||||||
while (fgets(buf, sizeof(buf), procmeminfo)) {
|
while (fgets(buf, sizeof(buf), procmeminfo)) {
|
||||||
char unit[10];
|
char unit[10];
|
||||||
*unit = 0;
|
*unit = 0;
|
||||||
if ((3 == sscanf(buf, "%[^:]: %llu %s", a, &v, unit))
|
if ((3 == sscanf(buf, "%[^:]: %zu %s", a, &v, unit))
|
||||||
|| (2 == sscanf(buf, "%[^:]: %llu", a, &v))) {
|
|| (2 == sscanf(buf, "%[^:]: %zu", a, &v))) {
|
||||||
if (*unit == 'k')
|
if (*unit == 'k')
|
||||||
v <<= 10;
|
v <<= 10;
|
||||||
if (!strcasecmp(a, "Cached")){
|
if (!strcasecmp(a, "Cached")){
|
||||||
|
Reference in New Issue
Block a user