commit ed8b7e8954d302f73907f1cc302d124443f947aa
Author: Laslo Hunhold <[email protected]>
AuthorDate: Mon Mar 5 01:04:51 2018 +0100
Commit: Laslo Hunhold <[email protected]>
CommitDate: Mon Mar 5 01:04:51 2018 +0100
Fix a logic error
We want to xor s.host and udsname, so it especially errors out when none
are given.
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();
}