]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix suspect code indent
authorDimitri Papadopoulos <3350651+DimitriPapadopoulos@users.noreply.gitlab.com>
Wed, 16 Jun 2021 11:27:25 +0000 (13:27 +0200)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Tue, 29 Jun 2021 10:45:55 +0000 (12:45 +0200)
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>
auth-common.c
auth-globalprotect.c
auth.c
fortinet.c
main.c
pulse.c
script.c

index 1f3fa4dc074b51f5443fca25d869cfb11be20194..8d7ea39d23ad1de6a915c8f21e9fb417ca847d68 100644 (file)
@@ -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;
index a698cb436680e46ebfc662a0aed27e56cbaf7484..b10469113bb687d854ddccf31a3787371491b9fc 100644 (file)
@@ -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)) {
@@ -656,7 +656,7 @@ static int gpst_login(struct openconnect_info *vpninfo, int portal, struct login
                                        goto replay_form;
                                }
                        } else
-                         break;
+                               break;
                }
        }
 
diff --git a/auth.c b/auth.c
index f074783079d62ba37e26d6416b958e5221a48f11..8e40f738550b8855331139f0e473d07565dbea97 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -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));
@@ -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);
                }
@@ -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;
 }
index 08ca63cecb3822ad163cdac60b0fb5acc06f0032..cfb706d243925426d99547b0e438c47fe9ca1646 100644 (file)
@@ -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) {
diff --git a/main.c b/main.c
index 48e5bbed19f49f2ec195c03d14f0a6b93447b4e6..e7e659828eae91cf00453111b5dfb8cc68ce442d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -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 */
@@ -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);
                        }
                }
        }
@@ -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);
diff --git a/pulse.c b/pulse.c
index 534bed13275df72c0aa64e6c29bce3fa9df187ee..51a157b174b0d9cc5093890389af9af17fb02652 100644 (file)
--- a/pulse.c
+++ b/pulse.c
@@ -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);
index d6f8bb8f0eccd259766097bde2d70b11d39f6262..6d1ec72fa1e8bf029bb9ac149cfff8757b67de5f 100644 (file)
--- a/script.c
+++ b/script.c
@@ -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])