From a5a4b4e2f881f24f085aa61f34ad0f901f73e096 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Thu, 19 Apr 2001 21:42:45 +0000 Subject: [PATCH] - Use memcpy() instead of strlcpy() which is faster. --- ext/odbc/php_odbc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 7d62f6587a..15220393d4 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1933,14 +1933,13 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int if (strstr((char*)db, ";")) { direct = 1; - if (uid && !strstr ((char*)db, "uid") && - !strstr((char*)db, "UID")) { - ldb = (char*)emalloc(strlen(db) + strlen(uid) + strlen(pwd) + 12); + if (uid && !strstr ((char*)db, "uid") && !strstr((char*)db, "UID")) { + ldb = (char*) emalloc(strlen(db) + strlen(uid) + strlen(pwd) + 12); sprintf(ldb, "%s;UID=%s;PWD=%s", db, uid, pwd); } else { - ldb_len = (strlen(db)+1); - ldb = (char*)emalloc(ldb_len); - strlcpy(ldb, db, ldb_len); + ldb_len = strlen(db)+1; + ldb = (char*) emalloc(ldb_len); + memcpy(ldb, db, ldb_len); } } -- 2.50.1