cvs: php4 /ext/mysql php_mysql.c
| From: | Zak Greant | Date: | Wed, 09 Oct 2002 13:05:42 +0000 |
| Subject: | cvs: php4 /ext/mysql php_mysql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14741@lists.php.net to get a copy of this message | ||
zak Wed Oct 9 09:05:42 2002 EDT
Modified files:
/php4/ext/mysql php_mysql.c
Log:
Minor tweak - using memcpy(), instead of strcpy() for static strings. Gives better performance.
Thanks Zeev.
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.165 php4/ext/mysql/php_mysql.c:1.166
--- php4/ext/mysql/php_mysql.c:1.165 Wed Oct 9 08:33:40 2002
+++ php4/ext/mysql/php_mysql.c Wed Oct 9 09:05:42 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.165 2002/10/09 12:33:40 zak Exp $ */
+/* $Id: php_mysql.c,v 1.166 2002/10/09 13:05:42 zak Exp $ */
/* TODO:
*
@@ -252,12 +252,12 @@
}
/* rollback possible transactions */
- strcpy (query, "ROLLBACK");
+ memcpy(query, "ROLLBACK", sizeof("ROLLBACK"));
/* Binary safe query not required here */
mysql_query(&link->conn, query);
/* restore session variable "autocommit" to default (=1) */
- strcpy (query, "SET AUTOCOMMIT=1");
+ memcpy(query, "SET AUTOCOMMIT=1", sizeof("SET AUTOCOMMIT=1"));
/* Binary safe query not required here */
mysql_query(&link->conn, query);
@@ -2198,7 +2198,7 @@
Z_TYPE_P(return_value) = IS_STRING;
break;
case PHP_MYSQL_FIELD_FLAGS:
- strcpy(buf, "");
+ memcpy(buf, "", sizeof(""));
#ifdef IS_NOT_NULL
if (IS_NOT_NULL(mysql_field->flags)) {
strcat(buf, "not_null ");