diff options
author | 1998-08-04 17:50:58 +0000 | |
---|---|---|
committer | 1998-08-04 17:50:58 +0000 | |
commit | 493e77fff64dfa3e02bc7f892b5f42717e1fbb24 (patch) | |
tree | 702de9b32636db47c6c4ffd87febe89b53508b2b | |
parent | Fix by Federico G. Schwindt <fgsch@olimpo.com.br> for YM ISA PNP driver (diff) | |
download | wireguard-openbsd-493e77fff64dfa3e02bc7f892b5f42717e1fbb24.tar.xz wireguard-openbsd-493e77fff64dfa3e02bc7f892b5f42717e1fbb24.zip |
fix parsing on chat script when passed on the command line; problem noted by fgsch@olimpo.com.br but different fix committed.
-rw-r--r-- | usr.sbin/pppd/chat/chat.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pppd/chat/chat.c b/usr.sbin/pppd/chat/chat.c index 53120e4c720..4d59b7808aa 100644 --- a/usr.sbin/pppd/chat/chat.c +++ b/usr.sbin/pppd/chat/chat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chat.c,v 1.7 1998/05/08 04:52:36 millert Exp $ */ +/* $OpenBSD: chat.c,v 1.8 1998/08/04 17:50:58 millert Exp $ */ /* * Chat -- a program for automatic session establishment (i.e. dial @@ -83,7 +83,7 @@ #if 0 static char rcsid[] = "Id: chat.c,v 1.19 1998/03/24 23:57:48 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: chat.c,v 1.7 1998/05/08 04:52:36 millert Exp $"; +static char rcsid[] = "$OpenBSD: chat.c,v 1.8 1998/08/04 17:50:58 millert Exp $"; #endif #endif @@ -349,13 +349,13 @@ main(argc, argv) else do_file (chat_file); } else { - while (*argv != NULL) { - chat_expect(*argv); + while (argc-- > 0) { + chat_expect(*argv++); - if (*(++argv) != NULL) - chat_send(*argv); + if (argc-- > 0) { + chat_send(*argv++); + } } - argv++; } terminate(0); |