[news.software.b] Cnews & nntp 1.5.7

netmgr@finsun.csc.fi (Pekka Kytolaakso) (03/04/90)

I just installed Cnews & latest nntp and found a bug (or is it afeature?)
in nntp server's command XHDR:

# telnet venus.csc.fi nntp
Trying 128.214.46.21 ...
Connected to venus.csc.fi.
Escape character is '^]'.
200 venus NNTP server version 1.5.6 (27 August 89) ready at Sun Mar  4 15:16:58 1
990 (posting ok).
group junk
211 31 1 31 junk
xhdr message-id 30-31
221 message-id fields follow
1 <9003021508.AA29255@funet.fi>
2 <1990Mar2.143137.23843@santra.uucp>
3 <9003021529.AA29746@funet.fi>
 ... [lines deleted to mage message smaller]
29 <31947@bigtex.cactus.org>
30 <BRIAN.90Mar4030443@radio.astro.utoronto.ca>
31 <31954@bigtex.cactus.org>
31 <31954@bigtex.cactus.org>
1 <9003021508.AA29255@funet.fi>
.


As you can see there are two extra lines in the  bottom. 
An easy fix is to add checking for end of articles to
the for loop in server/xhdr.c:

*** xhdr.c.orig Sun Mar  4 15:02:42 1990
--- xhdr.c      Sun Mar  4 15:13:48 1990
***************
*** 112,118 ****

        printf("%d %s fields follow\r\n", OK_HEAD, argv[1]);

!       for (;; artptr++) {
                if ((artnum = art_array[artptr]) < low)
                        continue;
                if (artnum > high)
--- 112,118 ----

        printf("%d %s fields follow\r\n", OK_HEAD, argv[1]);

!       for (;artptr<num_arts; artptr++) {
                if ((artnum = art_array[artptr]) < low)
                        continue;
                if (artnum > high)

Pekka Kyt|laakso
---------------------------------------------------------------
netmgr@csc.fi            Center for Scientific Computing
NETMGR@FINFUN.BITNET     PL 40   SF-02101 Espoo FINLAND
Phone: +358 0 4571       Telefax: + 358 0 4572302

lamy@cs.toronto.edu (Jean-Francois Lamy) (03/04/90)

netmgr@finsun.csc.fi (Pekka Kytolaakso) writes:

>I just installed Cnews & latest nntp and found a bug (or is it afeature?)
>in nntp server's command XHDR:

I don't think this has anything to do with C news.

Jean-Francois Lamy               lamy@cs.utoronto.ca, uunet!cs.utoronto.ca!lamy
Department of Computer Science, University of Toronto, Canada M5S 1A4