]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: arg: remove extra check in make_arg_list arg escaping
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 22 Nov 2022 10:48:12 +0000 (11:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 22 Nov 2022 15:27:52 +0000 (16:27 +0100)
Len cannot be equal to 1 when entering in escape handling code.
But yet, an extra "len == 1" check was performed.

Removing this useless check.

This was reported by Ilya with the help of cppcheck.

src/arg.c

index 17f5ed061d6230d02f07d160fad098a45046b211..2810050b0fa66dec17295570864e18b4e5905092 100644 (file)
--- a/src/arg.c
+++ b/src/arg.c
@@ -182,7 +182,7 @@ int make_arg_list(const char *in, int len, uint64_t mask, struct arg **argp,
                        }
                        else if (*in == '\\' && !squote && len != 1) {
                                /* '\', ', ' ', '"' support being escaped by '\' */
-                               if (len == 1 || in[1] == 0)
+                               if (in[1] == 0)
                                        goto unquote_err;
 
                                if (in[1] == '\\' || in[1] == ' ' || in[1] == '"' || in[1] == '\'') {