From: Andi Gutmans Date: Thu, 19 Apr 2001 21:42:45 +0000 (+0000) Subject: - Use memcpy() instead of strlcpy() which is faster. X-Git-Tag: php-4.0.6RC1~363 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5a4b4e2f881f24f085aa61f34ad0f901f73e096;p=php - Use memcpy() instead of strlcpy() which is faster. --- 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); } }