summaryrefslogtreecommitdiff
path: root/chat
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>1997-04-30 05:40:50 +0000
committerPaul Mackerras <paulus@samba.org>1997-04-30 05:40:50 +0000
commitd8f539f8de6c09c8689f21404cdc09947a80114b (patch)
treee2482116c395e97d53dafaffceff9092a3481dba /chat
parent3a918b1929920a11c10f0e9ec840e0ce7768cb85 (diff)
downloadppp-d8f539f8de6c09c8689f21404cdc09947a80114b.tar.gz
fix compilation warnings, reset quiet for each send string
Diffstat (limited to 'chat')
-rw-r--r--chat/chat.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/chat/chat.c b/chat/chat.c
index 3461e2b..812a785 100644
--- a/chat/chat.c
+++ b/chat/chat.c
@@ -34,15 +34,19 @@
*
*/
-static char rcsid[] = "$Id: chat.c,v 1.13 1997/03/04 03:25:59 paulus Exp $";
+#ifndef lint
+static char rcsid[] = "$Id: chat.c,v 1.14 1997/04/30 05:40:50 paulus Exp $";
+#endif
#include <stdio.h>
+#include <ctype.h>
#include <time.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
@@ -160,6 +164,9 @@ char *clean __P((register char *s, int sending));
void break_sequence __P((void));
void terminate __P((int status));
void die __P((void));
+char *expect_strtok __P((char *, char *));
+
+int main __P((int, char *[]));
void *dup_mem(b, c)
void *b;
@@ -197,7 +204,7 @@ char **argv;
program_name = *argv;
tzset();
- while (option = OPTION(argc, argv))
+ while ((option = OPTION(argc, argv)) != 0)
{
switch (option)
{
@@ -214,7 +221,7 @@ char **argv;
break;
case 'f':
- if (arg = OPTARG(argc, argv))
+ if ((arg = OPTARG(argc, argv)) != NULL)
{
chat_file = copy_of(arg);
}
@@ -225,7 +232,7 @@ char **argv;
break;
case 't':
- if (arg = OPTARG(argc, argv))
+ if ((arg = OPTARG(argc, argv)) != NULL)
{
timeout = atoi(arg);
}
@@ -301,11 +308,11 @@ char **argv;
}
else
{
- while (arg = ARG(argc, argv))
+ while ((arg = ARG(argc, argv)) != NULL)
{
chat_expect(arg);
- if (arg = ARG(argc, argv))
+ if ((arg = ARG(argc, argv)) != NULL)
{
chat_send(arg);
}
@@ -313,6 +320,7 @@ char **argv;
}
terminate(0);
+ return 0;
}
/*
@@ -322,7 +330,7 @@ char **argv;
void do_file (chat_file)
char *chat_file;
{
- int linect, len, sendflg;
+ int linect, sendflg;
char *sp, *arg, quote;
char buf [STR_LEN];
FILE *cfp;
@@ -714,7 +722,7 @@ int sending;
break;
case 'q':
- quiet = ! quiet;
+ quiet = 1;
break;
case 'r':
@@ -1179,6 +1187,7 @@ int c;
int put_string (s)
register char *s;
{
+ quiet = 0;
s = clean(s, 1);
if (verbose)