Skip to content

Commit

Permalink
Fix suspect code indent
Browse files Browse the repository at this point in the history
Warnings by checkpatch.pl.
I have fixed actual errors and left actual conscious decisions.

Signed-off-by: Dimitri Papadopoulos <3350651+DimitriPapadopoulos@users.noreply.gitlab.com>
  • Loading branch information
Dimitri Papadopoulos authored and Dimitri Papadopoulos committed Jun 29, 2021
1 parent 0a68cdf commit 789e04e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion auth-common.c
Expand Up @@ -74,7 +74,7 @@ int xmlnode_match_prop(xmlNode *xml_node, const char *name, const char *match)
return -ENOENT;

if (strcmp(str, match))
ret = -EEXIST;
ret = -EEXIST;

free(str);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions auth-globalprotect.c
Expand Up @@ -431,7 +431,7 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node,
if (xmlnode_is_named(x2, "external"))
for (x3 = x2->children; x3; x3 = x3->next)
if (xmlnode_is_named(x3, "list"))
gateways = x3;
gateways = x3;
} else if (xmlnode_is_named(x, "hip-collection")) {
for (x2 = x->children; x2; x2 = x2->next) {
if (!xmlnode_get_val(x2, "hip-report-interval", &hip_interval)) {
Expand Down Expand Up @@ -656,7 +656,7 @@ static int gpst_login(struct openconnect_info *vpninfo, int portal, struct login
goto replay_form;
}
} else
break;
break;
}
}

Expand Down
8 changes: 4 additions & 4 deletions auth.c
Expand Up @@ -89,7 +89,7 @@ static int parse_auth_choice(struct openconnect_info *vpninfo, struct oc_auth_fo

/* Return early when there is a <select/> tag with no children */
if (max_choices == 0) {
return 0;
return 0;
}

opt = calloc(1, sizeof(*opt));
Expand Down Expand Up @@ -689,7 +689,7 @@ static int handle_auth_form(struct openconnect_info *vpninfo, struct oc_auth_for
*/
free(form->error);
if (!(form->error = strdup(_("Client certificate missing or incorrect (Certificate Validation Failure)"))))
return -ENOMEM;
return -ENOMEM;
} else
vpn_progress(vpninfo, PRG_ERR, "%s\n", form->error);
}
Expand Down Expand Up @@ -935,8 +935,8 @@ static int cstp_can_gen_tokencode(struct openconnect_info *vpninfo,
#endif
/* Otherwise it's an OATH token of some kind. */
if (!strcmp(opt->name, "secondary_password") ||
(form->auth_id && !strcmp(form->auth_id, "challenge")))
return can_gen_tokencode(vpninfo, form, opt);
(form->auth_id && !strcmp(form->auth_id, "challenge")))
return can_gen_tokencode(vpninfo, form, opt);

return -EINVAL;
}
Expand Down
16 changes: 8 additions & 8 deletions fortinet.c
Expand Up @@ -343,14 +343,14 @@ static int parse_fortinet_xml_config(struct openconnect_info *vpninfo, char *buf
} else if (xmlnode_is_named(xml_node, "fos")) {
char platform[80], *p = platform, *e = platform + 80;
if (!xmlnode_get_prop(xml_node, "platform", &s)) {
p+=snprintf(p, e-p, "%s", s);
if (!xmlnode_get_prop(xml_node, "major", &s)) p+=snprintf(p, e-p, " v%s", s);
if (!xmlnode_get_prop(xml_node, "minor", &s)) p+=snprintf(p, e-p, ".%s", s);
if (!xmlnode_get_prop(xml_node, "patch", &s)) p+=snprintf(p, e-p, ".%s", s);
if (!xmlnode_get_prop(xml_node, "build", &s)) p+=snprintf(p, e-p, " build %s", s);
if (!xmlnode_get_prop(xml_node, "branch", &s)) snprintf(p, e-p, " branch %s", s);
vpn_progress(vpninfo, PRG_INFO,
_("Reported platform is %s\n"), platform);
p+=snprintf(p, e-p, "%s", s);
if (!xmlnode_get_prop(xml_node, "major", &s)) p+=snprintf(p, e-p, " v%s", s);
if (!xmlnode_get_prop(xml_node, "minor", &s)) p+=snprintf(p, e-p, ".%s", s);
if (!xmlnode_get_prop(xml_node, "patch", &s)) p+=snprintf(p, e-p, ".%s", s);
if (!xmlnode_get_prop(xml_node, "build", &s)) p+=snprintf(p, e-p, " build %s", s);
if (!xmlnode_get_prop(xml_node, "branch", &s)) snprintf(p, e-p, " branch %s", s);
vpn_progress(vpninfo, PRG_INFO,
_("Reported platform is %s\n"), platform);
}
} else if (xmlnode_is_named(xml_node, "ipv4")) {
for (x = xml_node->children; x; x=x->next) {
Expand Down
10 changes: 5 additions & 5 deletions main.c
Expand Up @@ -1013,7 +1013,7 @@ static inline char *__dup_config_arg(char **argv, char *config_arg)
char *res;

if (config_file || is_arg_utf8(config_arg))
return xstrdup(config_arg);
return xstrdup(config_arg);

res = convert_arg_to_utf8(argv, config_arg);
/* Force a copy, even if conversion failed */
Expand Down Expand Up @@ -2330,9 +2330,9 @@ static int validate_peer_cert(void *_vpninfo, const char *reason)
if (!err)
return 0;
else if (err < 0) {
vpn_progress(vpninfo, PRG_ERR,
_("Could not check server's certificate against %s\n"),
this->fingerprint);
vpn_progress(vpninfo, PRG_ERR,
_("Could not check server's certificate against %s\n"),
this->fingerprint);
}
}
}
Expand Down Expand Up @@ -2666,7 +2666,7 @@ static int lock_token(void *tokdata)
/* FIXME: Actually lock the file */
err = openconnect_read_file(vpninfo, token_filename, &file_token);
if (err < 0)
return err;
return err;

err = openconnect_set_token_mode(vpninfo, vpninfo->token_mode, file_token);
free(file_token);
Expand Down
2 changes: 1 addition & 1 deletion pulse.c
Expand Up @@ -375,7 +375,7 @@ static int process_attr(struct openconnect_info *vpninfo, struct oc_vpn_option *
if (!attrlen)
goto badlen;
if (!data[attrlen-1])
attrlen--;
attrlen--;
vpn_progress(vpninfo, PRG_DEBUG, _("Received DNS search domain %.*s\n"),
attrlen, (char *)data);
new_ip_info->domain = add_option_dup(new_opts, "search", (char *)data, attrlen);
Expand Down
4 changes: 2 additions & 2 deletions script.c
Expand Up @@ -347,8 +347,8 @@ void prepare_script_env(struct openconnect_info *vpninfo)
if (vpninfo->ip_info.netmask6 && !vpninfo->ip_info.addr6) {
char *slash = strchr(vpninfo->ip_info.netmask6, '/');
if (slash)
script_setenv(vpninfo, "INTERNAL_IP6_ADDRESS", vpninfo->ip_info.netmask6,
slash - vpninfo->ip_info.netmask6, 0);
script_setenv(vpninfo, "INTERNAL_IP6_ADDRESS", vpninfo->ip_info.netmask6,
slash - vpninfo->ip_info.netmask6, 0);
}

if (vpninfo->ip_info.dns[0])
Expand Down

0 comments on commit 789e04e

Please sign in to comment.