diff options
author | Benny Baumann <BenBE@geshi.org> | 2024-04-20 19:03:35 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2024-04-20 19:36:00 +0200 |
commit | 6f142695cbf5281dd2a5f67b7233d6b93111fa99 (patch) | |
tree | a389a9b3b8c1398ceafc3b236bb6bfabb67b356b /Settings.c | |
parent | 784ef0878a22e068c87a722059b0e813b1bc1dfe (diff) |
Use struct member to determine size of allocations
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -163,8 +163,8 @@ static void Settings_defaultMeters(Settings* this, unsigned int initialCpuCount) this->hLayout = HF_TWO_50_50; this->hColumns = xCalloc(HeaderLayout_getColumns(this->hLayout), sizeof(MeterColumnSetting)); for (size_t i = 0; i < 2; i++) { - this->hColumns[i].names = xCalloc(sizes[i] + 1, sizeof(char*)); - this->hColumns[i].modes = xCalloc(sizes[i], sizeof(MeterModeId)); + this->hColumns[i].names = xCalloc(sizes[i] + 1, sizeof(*this->hColumns[0].names)); + this->hColumns[i].modes = xCalloc(sizes[i], sizeof(*this->hColumns[0].modes)); this->hColumns[i].len = sizes[i]; } |