Index: chat.c =================================================================== RCS file: /cvs/src/usr.sbin/pppd/chat/chat.c,v retrieving revision 1.35 diff -u -p -r1.35 chat.c --- chat.c 5 Apr 2016 21:24:02 -0000 1.35 +++ chat.c 8 Mar 2023 03:51:44 -0000 @@ -19,7 +19,7 @@ * added -T and -U option and \T and \U substitution to pass a phone * number into chat script. Two are needed for some ISDN TA applications. * Keith Dart <kd...@cisco.com> - * + * * * Added SAY keyword to send output to stderr. * This allows to turn ECHO OFF and to output specific, user selected, @@ -43,7 +43,7 @@ * In the same vein as above, added CLR_REPORT keyword. * * Allow for comments. Line starting with '#' are comments and are - * ignored. If a '#' is to be expected as the first character, the + * ignored. If a '#' is to be expected as the first character, the * expect string must be quoted. * * @@ -167,7 +167,7 @@ int clear_abort_next = 0; char *report_string[MAX_REPORTS] ; char report_buffer[50] ; -int n_reports = 0, report_next = 0, report_gathering = 0 ; +int n_reports = 0, report_next = 0, report_gathering = 0 ; int clear_report_next = 0; int say_next = 0, hup_next = 0; @@ -321,7 +321,7 @@ main(argc, argv) } init(); - + if (chat_file != NULL) { if (argc > 0) usage(); @@ -641,7 +641,7 @@ int sending; /* set to 1 when sending ( t++; if (isoctal(*t)) { t++; - if (isoctal(*t)) + if (isoctal(*t)) t++; } } @@ -712,7 +712,7 @@ int sending; /* set to 1 when sending ( case 'T': if (sending && phone_num) { - for ( phchar = phone_num; *phchar != '\0'; phchar++) + for ( phchar = phone_num; *phchar != '\0'; phchar++) *s1++ = *phchar; } else { @@ -723,7 +723,7 @@ int sending; /* set to 1 when sending ( case 'U': if (sending && phone_num2) { - for ( phchar = phone_num2; *phchar != '\0'; phchar++) + for ( phchar = phone_num2; *phchar != '\0'; phchar++) *s1++ = *phchar; } else { @@ -760,7 +760,7 @@ int sending; /* set to 1 when sending ( else *s1++ = 'N'; break; - + default: if (isoctal (cur_chr)) { cur_chr &= 0x07; @@ -798,7 +798,7 @@ int sending; /* set to 1 when sending ( fprintf(stderr, "clean(): guessed %d and used %d\n", new_length, s1-ret); #endif if (new_length < s1 - ret) - logmsg("clean(): new_length too short! %d < %d: \"%s\" -> \"%s\"", + logmsg("clean(): new_length too short! %d < %d: \"%s\" -> \"%s\"", new_length, s1 - ret, s, ret); return ret; @@ -873,7 +873,7 @@ char *s; ++hup_next; return; } - + if (strcmp(s, "ABORT") == 0) { ++abort_next; return; @@ -1002,14 +1002,14 @@ register char *s; if (abort_next) { char *s1; - + abort_next = 0; - + if (n_aborts >= MAX_ABORTS) fatal(2, "Too many ABORT strings"); - + s1 = clean(s, 0); - + if (strlen(s1) > strlen(s) || strlen(s1) + 1 > sizeof(fail_buffer)) fatal(1, "Illegal or too-long ABORT string ('%v')", s); @@ -1026,11 +1026,11 @@ register char *s; int i; int old_max; int pack = 0; - + clear_abort_next = 0; - + s1 = clean(s, 0); - + if (strlen(s1) > strlen(s) || strlen(s1) + 1 > sizeof(fail_buffer)) fatal(1, "Illegal or too-long CLR_ABORT string ('%v')", s); @@ -1054,18 +1054,18 @@ register char *s; if (report_next) { char *s1; - + report_next = 0; if (n_reports >= MAX_REPORTS) fatal(2, "Too many REPORT strings"); - + s1 = clean(s, 0); - + if (strlen(s1) > strlen(s) || strlen(s1) > sizeof fail_buffer - 1) fatal(1, "Illegal or too-long REPORT string ('%v')", s); - + report_string[n_reports++] = s1; - + if (verbose) logmsg("report (%v)", s); return; @@ -1076,11 +1076,11 @@ register char *s; int i; int old_max; int pack = 0; - + clear_report_next = 0; - + s1 = clean(s, 0); - + if (strlen(s1) > strlen(s) || strlen(s1) > sizeof fail_buffer - 1) fatal(1, "Illegal or too-long REPORT string ('%v')", s); @@ -1098,14 +1098,14 @@ register char *s; free(s1); if (pack) pack_array(report_string,old_max); - + return; } if (timeout_next) { timeout_next = 0; timeout = atoi(s); - + if (timeout <= 0) timeout = DEFAULT_CHAT_TIMEOUT; @@ -1144,7 +1144,7 @@ int get_char() if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1) fatal(2, "Can't set file mode flags on stdin: %m"); - + return (-1); } } @@ -1162,17 +1162,17 @@ int c; switch (status) { case 1: return (0); - + default: logmsg("warning: write() on stdout returned %d", status); - + case -1: if ((status = fcntl(0, F_GETFL)) == -1) fatal(2, "Can't get file mode flags on stdin, %m"); if (fcntl(0, F_SETFL, status & ~O_NONBLOCK) == -1) fatal(2, "Can't set file mode flags on stdin: %m"); - + return (-1); } } @@ -1413,7 +1413,7 @@ register char *string; } alarm(0); - + if (verbose && printed) { if (alarmed) logmsg(" -- read timed out");