* Added qpdecode.c to the distribution (decodes quoted-printable)
authorArt Cancro <ajc@citadel.org>
Sun, 31 Jan 1999 23:30:29 +0000 (23:30 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 31 Jan 1999 23:30:29 +0000 (23:30 +0000)
        * Finished the MIME parser
        * Gave MSG0 a reasonable behaviour for MIME messages

citadel/ChangeLog
citadel/mime_parser.c

index 2abd6e269cc7ab2c05dbfb11e74787018dfd9de4..1a50c2fd437fc206fd002b1de1eb1965a0c73981 100644 (file)
@@ -1,3 +1,8 @@
+Sun Jan 31 18:29:18 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * Added qpdecode.c to the distribution (decodes quoted-printable)
+       * Finished the MIME parser
+       * Gave MSG0 a reasonable behaviour for MIME messages
+
 Sat Jan 30 18:39:53 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Look for citadel.rc in current directory if not found elsewhere
        * More work on the MIME parser
index 2b0d70710a07f451c850f22635d63cd38f90ab89..bbed98eef56a756faf2447e87e77c8d5478de279 100644 (file)
@@ -123,9 +123,10 @@ void mime_decode(char *partnum,
         * Allocate a buffer for the decoded data.  The output buffer is the
         * same size as the input buffer; this assumes that the decoded data
         * will never be larger than the encoded data.  This is a safe
-        * assumption with base64, uuencode, and quoted-printable.
+        * assumption with base64, uuencode, and quoted-printable.  Just to
+        * be safe, we still pad the buffer a bit.
         */
-       decoded = mallok(length);
+       decoded = mallok(length + 1024);
        if (decoded == NULL) {
                lprintf(5, "ERROR: cannot allocate memory.\n");
                return;
@@ -140,7 +141,7 @@ void mime_decode(char *partnum,
                }
 
        if (childpid == 0) {
-               /* close(2); FIX uncomment this when solid */
+               close(2);
                /* send stdio to the pipes */
                if (dup2(sendpipe[0], 0)<0) lprintf(5, "ERROR dup2()\n");
                if (dup2(recvpipe[1], 1)<0) lprintf(5, "ERROR dup2()\n");
@@ -187,6 +188,7 @@ void mime_decode(char *partnum,
        if (bytes_recv > 0)
                CallBack(name, filename, partnum, disposition, decoded,
                        content_type, bytes_recv);
+
        phree(decoded);
        }