summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorZak Greant <zak@php.net>2002-10-09 13:05:42 +0000
committerZak Greant <zak@php.net>2002-10-09 13:05:42 +0000
commit6a590082caaff9a6497153a27f24695a38dd5052 (patch)
treef788601df7a6565e0e31e980ec35421a5f6862c1 /ext/mysql/php_mysql.c
parent382a92cc5aa2603cf5ec5d0b14a5b653ad4ffe13 (diff)
downloadphp-git-6a590082caaff9a6497153a27f24695a38dd5052.tar.gz
Minor tweak - using memcpy(), instead of strcpy() for static strings. Gives better performance. Thanks Zeev.
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 71f4277ef5..883b4ae0cf 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -252,12 +252,12 @@ static int _restore_connection_defaults(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
/* 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 @@ static void php_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
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 ");