diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-25 17:31:43 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-01-25 17:33:29 +0100 |
commit | 0f04714a035e2024385237d5698ee9488f88a22e (patch) | |
tree | 1b9f02dd49d688d0da2e2ccf6df828d9e37d9fa5 /Settings.c | |
parent | 2ec44098f9ca6604f2e897bbc4e2ee164049107f (diff) |
Fix possible division by zero
Do not pass a nmemb of 0 to calloc, cause it's unportable and forbidden
with our wrapper.
Found by Coverity
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -45,7 +45,7 @@ static void Settings_readMeterModes(Settings* this, const char* line, int column len++; } this->columns[column].len = len; - int* modes = xCalloc(len, sizeof(int)); + int* modes = len ? xCalloc(len, sizeof(int)) : NULL; for (int i = 0; i < len; i++) { modes[i] = atoi(ids[i]); } |