cvs: php4 /ext/dbase dbf_head.c
| From: | Vlad Krupin | Date: | Fri, 13 Dec 2002 03:09:53 +0000 |
| Subject: | cvs: php4 /ext/dbase dbf_head.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-17200@lists.php.net to get a copy of this message | ||
vlad Thu Dec 12 22:09:53 2002 EDT
Modified files:
/php4/ext/dbase dbf_head.c
Log:
Fix for bug 19727. dBase5 (at least for windows) seems to allow 1024 fields
Index: php4/ext/dbase/dbf_head.c
diff -u php4/ext/dbase/dbf_head.c:1.10 php4/ext/dbase/dbf_head.c:1.11
--- php4/ext/dbase/dbf_head.c:1.10 Mon Oct 8 17:52:26 2001
+++ php4/ext/dbase/dbf_head.c Thu Dec 12 22:09:52 2002
@@ -43,13 +43,13 @@
dbhead.dbh_date[DBH_DATE_DAY]);
/* malloc enough memory for the maximum number of fields:
- 32 * 254 = 8128 bytes */
- tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*254);
+ 32 * 1024 = 32K dBase5 (for Win) seems to allow that many */
+ tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*1024);
offset = 1;
nfields = 0;
gf_retval = 0;
- for (cur_f = tdbf; gf_retval < 2 && nfields < 254; cur_f++) {
+ for (cur_f = tdbf; gf_retval < 2 && nfields < 1024; cur_f++) {
gf_retval = get_dbf_field(dbh, cur_f);
if (gf_retval < 0) {