INN commit: branches/2.6/doc/man (libinn.3)

INN Commit rra at isc.org
Sat Mar 10 14:53:02 UTC 2018


    Date: Saturday, March 10, 2018 @ 06:53:01
  Author: iulius
Revision: 10265

libinn documentation:  fix sample code

HeaderFind() no longer exists, and a few other functions have
additionnal arguments.

Modified:
  branches/2.6/doc/man/libinn.3

----------+
 libinn.3 |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

Modified: libinn.3
===================================================================
--- libinn.3	2018-03-10 14:52:27 UTC (rev 10264)
+++ libinn.3	2018-03-10 14:53:01 UTC (rev 10265)
@@ -427,23 +427,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);
@@ -451,10 +448,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