PHP 4.0 Bug #5993 Updated: numeric fields with field len > 10 are chopped
| From: | Bug Database | Date: | Fri, 29 Sep 2000 13:15:22 +0000 |
| Subject: | PHP 4.0 Bug #5993 Updated: numeric fields with field len > 10 are chopped | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33857@lists.php.net to get a copy of this message | ||
ID: 5993
Updated by: sniper
Reported By: bazsi@balabit.hu
Status: Analyzed
Bug Type: dBase related
Assigned To:
Comments:
This isn't fixed.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-08-23 08:55:38] sniper@php.net
Is this one fixed in newer versions of php4?
(CVS or snaps.php.net)
--Jani
---------------------------------------------------------------------------
[2000-08-06 18:44:05] bazsi@balabit.hu
Here's the patch to fix the bug above:
diff -urN php-4.0.1pl2/ext/dbase/dbase.c php-4.0.1pl2.bazsi/ext/dbase/dbase.c
--- php-4.0.1pl2/ext/dbase/dbase.c Sun Jun 25 19:02:44 2000
+++ php-4.0.1pl2.bazsi/ext/dbase/dbase.c Sun Aug 6 18:42:16 2000
@@ -455,7 +455,12 @@
case 'N': /* FALLS THROUGH */
case 'L': /* FALLS THROUGH */
if (cur_f->db_fdc == 0) {
- add_next_index_long(return_value, strtol(str_value, NULL, 10));
+ if (cur_f->db_flen >= 10) {
+ add_next_index_string(return_value, str_value, 1);
+ }
+ else {
+ add_next_index_long(return_value, strtol(str_value, NULL,
10));
+ }
} else {
add_next_index_double(return_value, atof(str_value));
}
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=5993