Commit c9a27c95 authored by Petr Baudis's avatar Petr Baudis
Browse files

compctld memory_limits(): Fix retrieving total memory amount

parent 04b0fdd6
......@@ -30,7 +30,9 @@ memory_limits(size_t *minuser, size_t *mincomp, size_t *maxcomp, size_t *total)
char line[1024];
while (fgets(line, sizeof(line), f)) {
if (begins_with("MemTotal:", line)) {
sscanf(line, "MemTotal: %zu", total);
*total = 0;
sscanf(line, "MemTotal:%zu", total);
*total *= 1024;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment