Skip to content
Snippets Groups Projects
Commit c9a27c95 authored by Petr Baudis's avatar Petr Baudis
Browse files

compctld memory_limits(): Fix retrieving total memory amount

parent 04b0fdd6
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,9 @@ memory_limits(size_t *minuser, size_t *mincomp, size_t *maxcomp, size_t *total) ...@@ -30,7 +30,9 @@ memory_limits(size_t *minuser, size_t *mincomp, size_t *maxcomp, size_t *total)
char line[1024]; char line[1024];
while (fgets(line, sizeof(line), f)) { while (fgets(line, sizeof(line), f)) {
if (begins_with("MemTotal:", line)) { if (begins_with("MemTotal:", line)) {
*total = 0;
sscanf(line, "MemTotal:%zu", total); sscanf(line, "MemTotal:%zu", total);
*total *= 1024;
break; break;
} }
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment