cvs: php-src(PHP_5_0) /ext/imap php_imap.c
| From: | Ilia Alshanetsky | Date: | Wed, 29 Dec 2004 21:23:11 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/imap php_imap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-29695@lists.php.net to get a copy of this message | ||
iliaa Wed Dec 29 16:23:11 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/imap php_imap.c
Log:
MFH: Fixed bug #31142 (imap_mail_compose() fails to generate correct output).
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.184.2.5&r2=1.184.2.6&ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.184.2.5 php-src/ext/imap/php_imap.c:1.184.2.6
--- php-src/ext/imap/php_imap.c:1.184.2.5 Tue Dec 21 10:47:27 2004
+++ php-src/ext/imap/php_imap.c Wed Dec 29 16:23:11 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.184.2.5 2004/12/21 15:47:27 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.184.2.6 2004/12/29 21:23:11 iliaa Exp $ */
#define IMAP41
@@ -3168,37 +3168,29 @@
bod=&part->body;
- tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
- strcpy(tempstring, mystring);
+ tempstring = emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
+ sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
efree(mystring);
- mystring=tempstring;
- sprintf(mystring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
-
+ mystring = tempstring;
} while ((part = part->next)); /* until done */
/* output trailing cookie */
sprintf(tmp, "--%s--", cookie);
- tempstring=emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1);
- strcpy(tempstring, mystring);
+ tempstring = emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1);
+ sprintf(tempstring, "%s%s%s", mystring, tmp, CRLF);
efree(mystring);
- mystring=tempstring;
- sprintf(mystring, "%s%s%s", mystring, tmp, CRLF);
-
+ mystring = tempstring;
} else if (bod) {
-
- tempstring=emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
- strcpy(tempstring, mystring);
+ tempstring = emalloc(strlen(bod->contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
+ sprintf(tempstring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
efree(mystring);
- mystring=tempstring;
- sprintf(mystring, "%s%s%s", mystring, bod->contents.text.data, CRLF);
-
+ mystring = tempstring;
} else {
efree(mystring);
RETURN_FALSE;
}
- RETVAL_STRINGL(mystring, strlen(mystring), 1);
- efree(tempstring);
+ RETVAL_STRING(tempstring, 0);
}
/* }}} */