From ed8b7e8954d302f73907f1cc302d124443f947aa Mon Sep 17 00:00:00 2001 From: Laslo Hunhold Date: Mon, 5 Mar 2018 01:04:51 +0100 Subject: [PATCH] Fix a logic error We want to xor s.host and udsname, so it especially errors out when none are given. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 1c7d285..bce74a0 100644 --- a/main.c +++ b/main.c @@ -201,8 +201,8 @@ main(int argc, char *argv[]) usage(); } - /* allow either host or UNIX-domain socket, force port with host */ - if ((s.host && udsname) || (s.host && !s.port)) { + /* allow host xor UNIX-domain socket, force port with host */ + if ((!s.host == !udsname) || (s.host && !s.port)) { usage(); }