summaryrefslogtreecommitdiffstats
path: root/contrib/telnet
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/telnet')
-rw-r--r--contrib/telnet/telnet/commands.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/telnet/telnet/commands.c b/contrib/telnet/telnet/commands.c
index f0372a0..c450f43 100644
--- a/contrib/telnet/telnet/commands.c
+++ b/contrib/telnet/telnet/commands.c
@@ -2284,8 +2284,12 @@ tn(int argc, char *argv[])
#endif
(hostname = strrchr(hostp, ':')) == NULL)
hostname = strrchr(hostp, '@');
- hostname++;
- srcroute = 1;
+ if (hostname == NULL) {
+ hostname = hostp;
+ } else {
+ hostname++;
+ srcroute = 1;
+ }
} else
hostname = hostp;
if (!portp) {
OpenPOWER on IntegriCloud