Skip to content

Commit

Permalink
quota: assertion for *args != NULL is added in order to avoid warning…
Browse files Browse the repository at this point in the history
… from static analyzer and *args[0] changed to (*args)[0]
  • Loading branch information
Sergey-Kitov authored and GitLab committed Jun 7, 2017
1 parent 4c49732 commit e8760ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/plugins/quota/quota.c
Expand Up @@ -1395,6 +1395,7 @@ int quota_parse_parameters(struct quota_root *root, const char **args, const cha
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;
Expand All @@ -1405,9 +1406,9 @@ int quota_parse_parameters(struct quota_root *root, const char **args, const cha
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
Expand Down

0 comments on commit e8760ad

Please sign in to comment.