INN commit: trunk/doc/man (libinn.3)
INN Commit
rra at isc.org
Sat Mar 10 14:49:27 UTC 2018
Date: Saturday, March 10, 2018 @ 06:49:27
Author: iulius
Revision: 10262
libinn documentation: fix sample code
HeaderFind() no longer exists, and a few other functions have
additionnal arguments.
Modified:
trunk/doc/man/libinn.3
----------+
libinn.3 | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
Modified: libinn.3
===================================================================
--- libinn.3 2018-03-10 14:48:17 UTC (rev 10261)
+++ libinn.3 2018-03-10 14:49:27 UTC (rev 10262)
@@ -429,23 +429,20 @@
.RS
.nf
char *p;
-char *Article;
-char buff[256], errbuff[256];
+char frombuff[256], errbuff[256];
FILE *F;
FILE *ToServer;
FILE *FromServer;
int port = 119;
-if ((p = HeaderFind(Article, "From", 4)) == NULL)
- Fatal("Can't find From line");
-(void)strcpy(buff, p);
-HeaderCleanFrom(buff);
+strlcpy(frombuff, HDR(HDR__FROM), sizeof(frombuff));
+HeaderCleanFrom(frombuff);
if ((F = CAopen(FromServer, ToServer)) == NULL)
Fatal("Can't open active file");
/* Don't pass the file on to our children. */
-fdflag_close_exec(fileno(F), 1);
+fdflag_close_exec(fileno(F), true);
/* Make a local copy. */
p = ReadInDescriptor(fileno(F), (struct stat *)NULL);
@@ -453,10 +450,11 @@
/* Close the file. */
CAclose();
-if (NNTPremoteopen(port, &FromServer, &ToServer, errbuff) < 0)
+if (NNTPremoteopen(port, &FromServer, &ToServer, errbuff, sizeof(errbuff)) < 0)
Fatal("Can't connect to server");
-if ((p = GetModeratorAddress("comp.sources.unix")) == NULL)
+if ((p = GetModeratorAddress(NULL, NULL, "comp.sources.unix",
+ "%s at example.com")) == NULL)
Fatal("Can't find moderator's address");
.fi
.RE
More information about the inn-committers
mailing list