🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #31038

Re: 1,000,000 articles problem with TRN 3.4.1 [patch]

#31038
From: Arjan de Vet
Date: Mon, 10 Feb 1997 00:00
70 lines
2992 bytes
In article <5djilc$6da@ari.ari.net>, Gary <gmg@mtolympus.ari.net> wrote:

>I am unable to read newsgroups that have more than 999,999,999 articles.

You mean 999,999 I think.

>I'm using TRN 3.4.1
>
>Any suggestions?

This bug has recently been fixed in trn 4.0 beta. I include the patch
below but I'm not sure it works for trn 3.4.1, the code may have changed a
lot.

Arjan

-----------------------------------------------------------------------------
Index: rcln.c
@@ -30,4 +30,6 @@
 #include "rcln.h"
 
+#define MAX_DIGITS 7
+
 void
 rcln_init()
@@ -174,5 +176,5 @@
     morenum = isdigit(*s);		/* will it need a comma after? */
     *(np->rcline + np->numoffset - 1) = np->subscribechar;
-    mbuf = safemalloc((MEM_SIZE)(strlen(s) + (s - np->rcline) + 6+2+1));
+    mbuf = safemalloc((MEM_SIZE)(strlen(s)+(s - np->rcline)+MAX_DIGITS+2+1));
     strcpy(mbuf,np->rcline);		/* make new rc line */
     if (maxt && lastnum && artnum == lastnum+1)
@@ -297,5 +299,5 @@
 		}
 		*(np->rcline + np->numoffset - 1) = np->subscribechar;
-		mbuf = safemalloc((MEM_SIZE)(curlen + (artnum?(6+1)*2+1:1+1)));
+		mbuf = safemalloc((MEM_SIZE)(curlen+(artnum?(MAX_DIGITS+1)*2+1:1+1)));
 		*s = '\0';
 		strcpy(mbuf,np->rcline);	/* make new rc line */
@@ -400,6 +402,6 @@
     nums = np->rcline + np->numoffset;
     length = strlen(nums);
-    if (length+5+1 > sizeof tmpbuf)
-	mybuf = safemalloc((MEM_SIZE)(length+5+1));
+    if (length+MAX_DIGITS+1 > sizeof tmpbuf)
+	mybuf = safemalloc((MEM_SIZE)(length+MAX_DIGITS+1));
     strcpy(mybuf,nums);
     mybuf[length++] = ',';
@@ -487,6 +489,5 @@
 	    if (lastnum != 1) {
 		if (3+(int)strlen(s) > (int)strlen(np->rcline+np->numoffset)) {
-		    mbuf = safemalloc((MEM_SIZE)(np->numoffset + 3 +
-			strlen(s) + 1));
+		    mbuf = safemalloc((MEM_SIZE)(np->numoffset+3+strlen(s)+1));
 		    strcpy(mbuf, np->rcline);
 		    sprintf(mbuf+np->numoffset," 1-%s",s);
@@ -501,8 +502,8 @@
     }
     /* s now points to what should follow first range */
-    if (s - np->rcline > np->numoffset + 6+4+1)
+    if (s - np->rcline > np->numoffset + MAX_DIGITS+4+1)
 	mbuf = np->rcline;
     else {
-	mbuf = safemalloc((MEM_SIZE)(np->numoffset + strlen(s) + 6+4+1));
+	mbuf = safemalloc((MEM_SIZE)(np->numoffset+strlen(s)+MAX_DIGITS+4+1));
 	strcpy(mbuf,np->rcline);
     }

Technical Details
Message-ID: <5do5hk$68h$1@adv.IAEhv.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <5djilc$6da@ari.ari.net>

Show Full Headers
Complete Article Headers
Message-ID: <5do5hk$68h$1@adv.IAEhv.nl>
Subject: Re: 1,000,000 articles problem with TRN 3.4.1 [patch]
Date: Mon, 10 Feb 1997 00:00:00 +0000
From: devet@adv.IAEhv.nl (Arjan de Vet)
References: <5djilc$6da@ari.ari.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 217891530
Organization: Internet Access Eindhoven, The Netherlands
Newsgroups: news.software.readers
X-newsposter: Pnews 4.0-test53 (3 Feb 97)