From 105f626e763aeb5b85ef7d7f4b2f22e7e4644222 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 23 Jan 2017 10:11:26 +0200 Subject: [PATCH] IEC prefixes are matched case-insetensively If the case of the initial character does not matter, then the case of the following 'i' should not matter either. --- server/core/config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/core/config.c b/server/core/config.c index a97396904..32f3e310c 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -957,7 +957,7 @@ uint64_t config_get_size(const CONFIG_PARAMETER *params, const char *key) { case 'T': case 't': - if (*(end + 1) == 'i') + if ((*(end + 1) == 'i') || (*(end + 1) == 'I')) { size *= 1024ULL * 1024ULL * 1024ULL * 1024ULL; } @@ -969,7 +969,7 @@ uint64_t config_get_size(const CONFIG_PARAMETER *params, const char *key) case 'G': case 'g': - if (*(end + 1) == 'i') + if ((*(end + 1) == 'i') || (*(end + 1) == 'I')) { size *= 1024ULL * 1024ULL * 1024ULL; } @@ -981,7 +981,7 @@ uint64_t config_get_size(const CONFIG_PARAMETER *params, const char *key) case 'M': case 'm': - if (*(end + 1) == 'i') + if ((*(end + 1) == 'i') || (*(end + 1) == 'I')) { size *= 1024ULL * 1024ULL; } @@ -993,7 +993,7 @@ uint64_t config_get_size(const CONFIG_PARAMETER *params, const char *key) case 'K': case 'k': - if (*(end + 1) == 'i') + if ((*(end + 1) == 'i') || (*(end + 1) == 'I')) { size *= 1024ULL; }