INN commit: trunk/innd (art.c innd.h)

INN Commit Russ_Allbery at isc.org
Sun Nov 30 15:43:48 UTC 2008


    Date: Sunday, November 30, 2008 @ 07:43:47
  Author: iulius
Revision: 8201

Use a buffer for the Lines: header (to generate overview :lines metadata).

Modified:
  trunk/innd/art.c
  trunk/innd/innd.h

--------+
 art.c  |    7 ++++---
 innd.h |    9 +++++----
 2 files changed, 9 insertions(+), 7 deletions(-)

Modified: art.c
===================================================================
--- art.c	2008-11-30 13:31:30 UTC (rev 8200)
+++ art.c	2008-11-30 15:43:47 UTC (rev 8201)
@@ -1844,9 +1844,10 @@
 	}
 	break;
       case HDR__LINES:
-        p = NULL;
-        xasprintf(&p, "%d\r\n", data->Lines);
-        len = strlen(p) - 2;
+        snprintf(data->LinesBuffer, sizeof(data->LinesBuffer),
+                 "%d", data->Lines);
+        p = data->LinesBuffer;
+        len = strlen(data->LinesBuffer);
         break;
       default:
 	p = HDR(j);

Modified: innd.h
===================================================================
--- innd.h	2008-11-30 13:31:30 UTC (rev 8200)
+++ innd.h	2008-11-30 15:43:47 UTC (rev 8201)
@@ -222,12 +222,13 @@
   time_t	  Expires;		/* when article should be expired */
   int		  Lines;		/* number of body lines */
   int		  HeaderLines;		/* number of header lines */
+  char            LinesBuffer[SMBUF];   /* Generated Lines: header. */
   long		  BytesValue;		/* size of stored article, "\r\n" is
 					   counted as 2 bytes */
-  char		  Bytes[16];		/* generated Bytes header */
-  int		  BytesLength;		/* generated Bytes header length */
-  char	      *   BytesHeader;		/* where Bytes header begins in
-					   received article */
+  char            Bytes[SMBUF];         /* Generated Bytes: header. */
+  int             BytesLength;          /* Generated Bytes: header length. */
+  char        *   BytesHeader;          /* Where Bytes: header begins in
+                                           received article. */
   char		  TokenText[(sizeof(TOKEN) * 2) + 3];
 					/* token of stored article */
   LISTBUFFER	  Newsgroups;		/* newsgroup list */




More information about the inn-committers mailing list