]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Tue, 4 Mar 2003 16:35:02 +0000 (16:35 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 4 Mar 2003 16:35:02 +0000 (16:35 +0000)
ext/odbc/php_odbc.c

index ee36ac6ddfccf086b9542b8385d7d07f7168b7a7..ec8952a1e8018625fb99f098ad6d6c7de57785ff 100644 (file)
@@ -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