summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-03-04 16:35:02 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-03-04 16:35:02 +0000
commit802a410834d5f516a748ba69a53f44604d8f6185 (patch)
treebca9f8900b88b0c47c9ab0cd03c9a2b40dbaf308 /ext/odbc/php_odbc.c
parented2ea558a844e3e02c2cbcace4866ff49d9fe649 (diff)
downloadphp-git-802a410834d5f516a748ba69a53f44604d8f6185.tar.gz
MFH
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index ee36ac6ddf..ec8952a1e8 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -2220,15 +2220,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
persistent = 0;
}
- len = strlen(db) + strlen(uid) + strlen(pwd) + sizeof(ODBC_TYPE) + 5;
- hashed_details = emalloc(len);
-
- if (hashed_details == NULL) {
- php_error(E_WARNING, "Out of memory");
- RETURN_FALSE;
- }
-
- hashed_len = sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt);
+ hashed_len = spprintf(hashed_details, 0, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt);
/* FIXME the idea of checking to see if our connection is already persistent
is good, but it adds a lot of overhead to non-persistent connections. We