X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=chat%2Fchat.c;h=c9e01e2572851a56f51317a39a1c2cb93c686272;hb=a3630de20e34796f434a728bfd9cf1a961380c82;hp=6206cbea96c86b9d1f38f4ab90c4d6d7212c335c;hpb=93275f4388d54fed6b98a1ddac5b22ba7d60edab;p=ppp.git diff --git a/chat/chat.c b/chat/chat.c index 6206cbe..c9e01e2 100644 --- a/chat/chat.c +++ b/chat/chat.c @@ -77,11 +77,14 @@ * Columbus, OH 43221 * (614)451-1883 * - * */ +#ifndef __STDC__ +#define const +#endif + #ifndef lint -static const char rcsid[] = "$Id: chat.c,v 1.22 1999/08/12 03:56:05 paulus Exp $"; +static const char rcsid[] = "$Id: chat.c,v 1.24 1999/08/13 06:46:09 paulus Exp $"; #endif #include @@ -615,26 +618,26 @@ int status; exit(status); terminating = 1; echo_stderr(-1); - if (report_file != (char *) 0 && report_fp != (FILE *) NULL) { /* * Allow the last of the report string to be gathered before we terminate. */ - if (report_gathering) { - int c, rep_len; + if (report_gathering) { + int c, rep_len; - rep_len = strlen(report_buffer); - while (rep_len + 1 <= sizeof(report_buffer)) { - alarm(1); - c = get_char(); - alarm(0); - if (c < 0 || iscntrl(c)) - break; - report_buffer[rep_len] = c; - ++rep_len; - } - report_buffer[rep_len] = 0; - fprintf (report_fp, "chat: %s\n", report_buffer); + rep_len = strlen(report_buffer); + while (rep_len + 1 <= sizeof(report_buffer)) { + alarm(1); + c = get_char(); + alarm(0); + if (c < 0 || iscntrl(c)) + break; + report_buffer[rep_len] = c; + ++rep_len; } + report_buffer[rep_len] = 0; + fprintf (report_fp, "chat: %s\n", report_buffer); + } + if (report_file != (char *) 0 && report_fp != (FILE *) NULL) { if (verbose) fprintf (report_fp, "Closing \"%s\".\n", report_file); fclose (report_fp);