summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-01-25 17:31:43 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-01-25 17:33:29 +0100
commit0f04714a035e2024385237d5698ee9488f88a22e (patch)
tree1b9f02dd49d688d0da2e2ccf6df828d9e37d9fa5 /Settings.c
parent2ec44098f9ca6604f2e897bbc4e2ee164049107f (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Settings.c b/Settings.c
index 93e56f97..a2bb0962 100644
--- a/Settings.c
+++ b/Settings.c
@@ -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]);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy