tony2001 Thu Jan 18 15:55:09 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/pdo_firebird firebird_driver.c
Log:
MFH
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_firebird/firebird_driver.c?r1=1.17.2.2.2.2&r2=1.17.2.2.2.3&diff_format=u
Index: php-src/ext/pdo_firebird/firebird_driver.c
diff -u php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.2
php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.3
--- php-src/ext/pdo_firebird/firebird_driver.c:1.17.2.2.2.2 Mon Jan 1
09:36:04 2007
+++ php-src/ext/pdo_firebird/firebird_driver.c Thu Jan 18 15:55:09 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: firebird_driver.c,v 1.17.2.2.2.2 2007/01/01 09:36:04 sebastian Exp $ */
+/* $Id: firebird_driver.c,v 1.17.2.2.2.3 2007/01/18 15:55:09 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -602,6 +602,8 @@
{ "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 @@
/* 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;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php