Re: [PATCH] CLEANUP: tools: Clean up non-QUIC error message handling in str2sa_range()

2022-05-23 Thread Willy Tarreau
On Sun, May 22, 2022 at 12:40:58PM +0200, Tim Duesterhus wrote:
> 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.

OK that's fine like this. Now merged, thank you Tim!
Willy



[PATCH] CLEANUP: tools: Clean up non-QUIC error message handling in str2sa_range()

2022-05-22 Thread Tim Duesterhus
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 | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/tools.c b/src/tools.c
index 9e629e5bd..4c93e1e82 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -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;
}
 
-- 
2.36.1