Commit 70abaadb authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Fix NULL-termination of array for later use by String_freeArray.

parent a93db523
...@@ -107,7 +107,7 @@ static void Settings_defaultMeters(Settings* this, int cpuCount) { ...@@ -107,7 +107,7 @@ static void Settings_defaultMeters(Settings* this, int cpuCount) {
sizes[1]++; sizes[1]++;
} }
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
this->columns[i].names = calloc(sizes[i], sizeof(char*)); this->columns[i].names = calloc(sizes[i] + 1, sizeof(char*));
this->columns[i].modes = calloc(sizes[i], sizeof(int)); this->columns[i].modes = calloc(sizes[i], sizeof(int));
this->columns[i].len = sizes[i]; this->columns[i].len = sizes[i];
} }
......
Markdown is supported
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