summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2001-04-19 21:42:45 +0000
committerAndi Gutmans <andi@php.net>2001-04-19 21:42:45 +0000
commita5a4b4e2f881f24f085aa61f34ad0f901f73e096 (patch)
tree88e1387a55ece02638da86cbe1b135a803cc390e /ext/odbc/php_odbc.c
parentd7383e3255c6998bf71a577657f90dc291d3151e (diff)
downloadphp-git-a5a4b4e2f881f24f085aa61f34ad0f901f73e096.tar.gz
- Use memcpy() instead of strlcpy() which is faster.
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c11
1 files 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);
}
}