summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2015-12-06 12:00:17 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2015-12-06 12:00:17 +0000
commitfa781fc376a73a5fd66733de6d5f4f7078af5b97 (patch)
treeb7447c66b23c25dc7404a82c2b0478e2436553db /usr.bin
parente33812ae9ddd39e9387b8268ca681862956458ac (diff)
Use __progname instead of manually handling argv[0].
ok deraadt, mmcc, tedu
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/telnet/main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 6d42c75969c..b2972ba8e9d 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.35 2015/11/19 22:01:33 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.36 2015/12/06 12:00:16 tobias Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
@@ -77,6 +77,7 @@ int
main(int argc, char *argv[])
{
int ch;
+ extern char *__progname;
char *user, *alias;
const char *errstr;
@@ -84,10 +85,7 @@ main(int argc, char *argv[])
TerminalSaveState();
- if ((prompt = strrchr(argv[0], '/')))
- ++prompt;
- else
- prompt = argv[0];
+ prompt = __progname;
user = alias = NULL;