]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: tools: Clean up non-QUIC error message handling in str2sa_range()
authorTim Duesterhus <tim@bastelstu.be>
Sun, 22 May 2022 10:40:58 +0000 (12:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 May 2022 06:45:31 +0000 (08:45 +0200)
If QUIC support is enabled both branches of the ternary conditional are
identical, upsetting Coverity. Move the full conditional into the non-QUIC
preprocessor branch to make the code more clear.

This resolves GitHub issue #1710.

src/tools.c

index 9e629e5bd855269de2d956b90b76bc269bfe9f42..4c93e1e82f86de25ea0f91ff17798746f844d93f 100644 (file)
@@ -1305,13 +1305,14 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int
                                  (proto_type == PROTO_TYPE_DGRAM) ? "datagram" : "stream",
                                  ss.ss_family,
                                  str,
-                                 (ctrl_type == SOCK_STREAM && proto_type == PROTO_TYPE_DGRAM) ?
 #ifndef USE_QUIC
-                                 "; QUIC is not compiled in if this is what you were looking for."
+                                 (ctrl_type == SOCK_STREAM && proto_type == PROTO_TYPE_DGRAM)
+                                 ? "; QUIC is not compiled in if this is what you were looking for."
+                                 : ""
 #else
                                  ""
 #endif
-                                 :"");
+                               );
                        goto out;
                }