1 /* $Id: sendarticle.c 4076 2000-10-05 00:36:52Z rra $
12 ** Send a string of one or more lines down a stdio FILE using RFC977
13 ** conventions. Return -1 on error.
15 int NNTPsendarticle(char *p, FILE *F, bool Terminate)
19 for (; p && *p; next[-1] = '\n', p = next) {
20 /* Get pointer to next line. Truncate long lines. */
21 if ((next = strchr(p, '\n')) != NULL)
25 if (*p == '.' && putc('.', F) == EOF)
27 if (fprintf(F, "%s\r\n", p) == EOF)
35 if (Terminate && fprintf(F, ".\r\n") == EOF)
38 return fflush(F) == EOF || ferror(F) ? -1 : 0;