diff options
-rw-r--r-- | usr.sbin/ppp/chat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c index 6a038e9..9e9fa17 100644 --- a/usr.sbin/ppp/chat.c +++ b/usr.sbin/ppp/chat.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: chat.c,v 1.56 1999/05/27 09:50:10 brian Exp $ + * $Id: chat.c,v 1.57 1999/06/09 08:47:31 brian Exp $ */ #include <sys/param.h> @@ -181,7 +181,11 @@ chat_UpdateSet(struct descriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n) } else { int minus; - c->argptr = c->argv[++c->arg]; + if ((c->argptr = c->argv[++c->arg]) == NULL) { + /* End of script - all ok */ + c->state = CHAT_DONE; + return 0; + } if (c->state == CHAT_EXPECT) { /* Look for expect-send-expect sequence */ |