cvs: php4 /ext/odbc php_odbc.c

From: Date: Thu, 19 Apr 2001 21:42:45 +0000
Subject: cvs: php4 /ext/odbc php_odbc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5168@lists.php.net to get a copy of this message
andi Thu Apr 19 14:42:45 2001 EDT Modified files: /php4/ext/odbc php_odbc.c Log: - Use memcpy() instead of strlcpy() which is faster. Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.81 php4/ext/odbc/php_odbc.c:1.82 --- php4/ext/odbc/php_odbc.c:1.81 Thu Apr 19 12:55:05 2001 +++ php4/ext/odbc/php_odbc.c Thu Apr 19 14:42:45 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.81 2001/04/19 19:55:05 kalowsky Exp $ */ +/* $Id: php_odbc.c,v 1.82 2001/04/19 21:42:45 andi Exp $ */ #include "php.h" #include "php_globals.h" @@ -1933,14 +1933,13 @@ 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); } }

« previous php.cvs (#5168) next »