cvs: php-src(PHP_5_2) /ext/standard head.c mail.c
| From: | Ilia Alshanetsky | Date: | Thu, 25 Jan 2007 00:26:51 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard head.c mail.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-42873@lists.php.net to get a copy of this message | ||
iliaa Thu Jan 25 00:26:51 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard head.c mail.c
Log:
Eliminate strcat() and strcpy()
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/head.c?r1=1.84.2.1.2.4&r2=1.84.2.1.2.5&diff_format=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.84.2.1.2.4 php-src/ext/standard/head.c:1.84.2.1.2.5
--- php-src/ext/standard/head.c:1.84.2.1.2.4 Wed Jan 24 00:45:54 2007
+++ php-src/ext/standard/head.c Thu Jan 25 00:26:51 2007
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: head.c,v 1.84.2.1.2.4 2007/01/24 00:45:54 iliaa Exp $ */
+/* $Id: head.c,v 1.84.2.1.2.5 2007/01/25 00:26:51 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -109,7 +109,7 @@
} else {
sprintf(cookie, "Set-Cookie: %s=%s", name, value ? encoded_value : "");
if (expires > 0) {
- strcat(cookie, "; expires=");
+ strlcat(cookie, "; expires=", len + 100);
dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1,
expires, 0 TSRMLS_CC);
strlcat(cookie, dt, len + 100);
efree(dt);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/mail.c?r1=1.87.2.1.2.1&r2=1.87.2.1.2.2&diff_format=u
Index: php-src/ext/standard/mail.c
diff -u php-src/ext/standard/mail.c:1.87.2.1.2.1 php-src/ext/standard/mail.c:1.87.2.1.2.2
--- php-src/ext/standard/mail.c:1.87.2.1.2.1 Mon Jan 1 09:36:08 2007
+++ php-src/ext/standard/mail.c Thu Jan 25 00:26:51 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mail.c,v 1.87.2.1.2.1 2007/01/01 09:36:08 sebastian Exp $ */
+/* $Id: mail.c,v 1.87.2.1.2.2 2007/01/25 00:26:51 iliaa Exp $ */
#include <stdlib.h>
#include <ctype.h>
@@ -200,10 +200,7 @@
#endif
}
if (extra_cmd != NULL) {
- sendmail_cmd = emalloc (strlen (sendmail_path) + strlen (extra_cmd) + 2);
- strcpy (sendmail_cmd, sendmail_path);
- strcat (sendmail_cmd, " ");
- strcat (sendmail_cmd, extra_cmd);
+ spprintf(&sendmail_cmd, 0, "%s %s", sendmail_path, extra_cmd);
} else {
sendmail_cmd = sendmail_path;
}