Skip to content

Commit 389aa3f

Browse files
committed
store strlen(db) in a variable
1 parent 2a70a41 commit 389aa3f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/odbc/php_odbc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,8 +2096,9 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
20962096
if (strstr((char*)db, "=")) {
20972097
direct = 1;
20982098

2099-
bool use_uid_arg = !php_memnistr(db, "uid=", strlen("uid="), db + strlen(db));
2100-
bool use_pwd_arg = !php_memnistr(db, "pwd=", strlen("pwd="), db + strlen(db));
2099+
size_t db_len = strlen(db);
2100+
bool use_uid_arg = !php_memnistr(db, "uid=", strlen("uid="), db + db_len);
2101+
bool use_pwd_arg = !php_memnistr(db, "pwd=", strlen("pwd="), db + db_len);
21012102

21022103
/* Force UID and PWD to be set in the DSN */
21032104
if (use_uid_arg || use_pwd_arg) {

0 commit comments

Comments
 (0)