changeset 22210:0223995dd50a

quota: assertion for *args != NULL is added in order to avoid warning from static analyzer and *args[0] changed to (*args)[0]
author Sergey Kitov <sergey.kitov@open-xchange.com>
date Wed, 31 May 2017 14:32:30 +0300
parents a760b915beb9
children e7239fd6301f
files src/plugins/quota/quota.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/quota/quota.c	Wed May 24 18:27:10 2017 +0300
+++ b/src/plugins/quota/quota.c	Wed May 31 14:32:30 2017 +0300
@@ -1373,6 +1373,7 @@
 		for (; valid_params->param_name != NULL; ++valid_params) {
 			tmp_param_name = valid_params->param_name;
 			tmp_param_len = strlen(valid_params->param_name);
+			i_assert(*args != NULL);
 			if (strncmp(*args, tmp_param_name, tmp_param_len) == 0) {
 				tmp_param_val = NULL;
 				*args += tmp_param_len;
@@ -1383,9 +1384,9 @@
 						t_strdup_until(*args, next_colon);
 					*args = (next_colon == NULL) ? NULL : next_colon + 1;
 				}
-				else if (*args[0] == '\0' ||
-					 *args[0] == ':') {
-					*args = (*args[0] == ':') ? *args + 1 : NULL;
+				else if ((*args)[0] == '\0' ||
+					 (*args)[0] == ':') {
+					*args = ((*args)[0] == ':') ? *args + 1 : NULL;
 					/* in case parameter is a boolean second parameter
 					 * string parameter value will be ignored by param_handler
 					 * we just need some non-NULL value