cvs: php-src /ext/dbase dbase.c
| From: | Uwe Steinmann | Date: | Thu, 27 Nov 2003 11:32:06 +0000 |
| Subject: | cvs: php-src /ext/dbase dbase.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-24676@lists.php.net to get a copy of this message | ||
steinm Thu Nov 27 06:32:06 2003 EDT
Modified files:
/php-src/ext/dbase dbase.c
Log:
- set precision to 0 unless the field is of type N or I
Index: php-src/ext/dbase/dbase.c
diff -u php-src/ext/dbase/dbase.c:1.70 php-src/ext/dbase/dbase.c:1.71
--- php-src/ext/dbase/dbase.c:1.70 Tue Oct 14 03:49:34 2003
+++ php-src/ext/dbase/dbase.c Thu Nov 27 06:32:05 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbase.c,v 1.70 2003/10/14 07:49:34 steinm Exp $ */
+/* $Id: dbase.c,v 1.71 2003/11/27 11:32:05 steinm Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -791,7 +791,14 @@
add_assoc_long(row, "length", cur_f->db_flen);
/* number of decimals in field */
- add_assoc_long(row, "precision", cur_f->db_fdc);
+ switch (cur_f->db_type) {
+ case 'N':
+ case 'I':
+ add_assoc_long(row, "precision", cur_f->db_fdc);
+ break;
+ default:
+ add_assoc_long(row, "precision", 0);
+ }
/* format for printing %s etc */
add_assoc_string(row, "format", cur_f->db_format, 1);