diff options
author | Antony Dovgal <tony2001@php.net> | 2007-01-18 15:55:09 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-01-18 15:55:09 +0000 |
commit | 5f12c71382f64c585a57a48c476d82bf92ba88e8 (patch) | |
tree | 4bbe37e4e12ded68ecbc9f91e7c7126e2e5ee4fa /ext/pdo_firebird/firebird_driver.c | |
parent | 05c11fdfb20e94a3cdcc7afe1450079d294acf56 (diff) | |
download | php-git-5f12c71382f64c585a57a48c476d82bf92ba88e8.tar.gz |
MFH
Diffstat (limited to 'ext/pdo_firebird/firebird_driver.c')
-rw-r--r-- | ext/pdo_firebird/firebird_driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 803192545d..7e65a880a7 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -602,6 +602,8 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM { "role", NULL, 0 } }; int i, ret = 0; + short buf_len = 256, dpb_len; + pdo_firebird_db_handle *H = dbh->driver_data = pecalloc(1,sizeof(*H),dbh->is_persistent); php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 3); @@ -616,9 +618,11 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRM /* loop through all the provided arguments and set dpb fields accordingly */ for (i = 0; i < sizeof(dpb_flags); ++i) { - if (dpb_values[i]) { - dpb += sprintf(dpb, "%c%c%s", dpb_flags[i], (unsigned char)strlen(dpb_values[i]), + if (dpb_values[i] && buf_len > 0) { + dpb_len = snprintf(dpb, buf_len, "%c%c%s", dpb_flags[i], (unsigned char)strlen(dpb_values[i]), dpb_values[i]); + dpb += dpb_len; + buf_len -= dpb_len; } } |