finger

finger fortune@hhvn.uk
Log | Files | Refs | LICENSE

commit e33b6d1754d1f3a710f82e9b03bbc31499af3a3f
parent 8a5adac0956cc95b4f2b862219c22a7aec83b4e0
Author: hhvn <dev@hhvn.uk>
Date:   Sun, 11 Jul 2021 18:19:09 +0100

finger.c: die on missing host/port

Diffstat:
Mfinger.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/finger.c b/finger.c @@ -136,7 +136,11 @@ main(int argc, char *argv[]) { segment = ISPORT; } } - printf("user: %s | host: %s | port: %s\n", user, host, port); + + if (host[0] == '\0') + die(1, "no hostname\n"); + if (port[0] == '\0') + die(1, "no port\n"); finger(user, host, port, sendw); }