]> code.citadel.org Git - citadel.git/commitdiff
* CtdlReadMessageBody() -- fixed bug that caused the prepend buffer to be
authorArt Cancro <ajc@citadel.org>
Fri, 1 Mar 2002 04:16:22 +0000 (04:16 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Mar 2002 04:16:22 +0000 (04:16 +0000)
  discarded instead of prepended.  "Received:" lines now work.

citadel/ChangeLog
citadel/msgbase.c

index 5056d3319aa827af951d8334c7007d8d2eda7ec0..40d92d97d6cf76fd20d7d934bbfd41b4a80e6512 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.118  2002/03/01 04:16:22  ajc
+ * CtdlReadMessageBody() -- fixed bug that caused the prepend buffer to be
+   discarded instead of prepended.  "Received:" lines now work.
+
  Revision 590.117  2002/02/23 19:20:51  ajc
  * Do the use table purge in two phases to avoid crashy crashy
 
@@ -3357,3 +3361,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 6194f9a364d6d00dff054640eb831a4e6362923b..c2b18561062c9ccf936aa0bd57d52aa860af4d0a 100644 (file)
@@ -2024,10 +2024,18 @@ char *CtdlReadMessageBody(char *terminator,     /* token signalling EOT */
 
        if (exist == NULL) {
                m = mallok(4096);
+               m[0] = 0;
+               buffer_len = 4096;
+               message_len = 0;
        }
        else {
-               m = reallok(exist, strlen(exist) + 4096);
-               if (m == NULL) phree(exist);
+               message_len = strlen(exist);
+               buffer_len = message_len + 4096;
+               m = reallok(exist, buffer_len);
+               if (m == NULL) {
+                       phree(exist);
+                       return m;
+               }
        }
 
        /* flush the input if we have nowhere to store it */
@@ -2036,12 +2044,6 @@ char *CtdlReadMessageBody(char *terminator,      /* token signalling EOT */
                return(NULL);
        }
 
-       /* otherwise read it into memory */
-       else {
-               buffer_len = 4096;
-               m[0] = 0;
-               message_len = 0;
-       }
        /* read in the lines of message text one by one */
        while ( (client_gets(buf)>0) && strcmp(buf, terminator) ) {