[GRASS-dev] Re: [GRASS GIS] #720: G_trim_decimal(): don't chop 0s on strings ending in e+20

GRASS GIS trac at osgeo.org
Thu Aug 20 07:25:38 EDT 2009


#720: G_trim_decimal(): don't chop 0s on strings ending in e+20
-----------------------+----------------------------------------------------
  Reporter:  hamish    |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  libgis    |     Version:  6.4.0 RCs                
Resolution:            |    Keywords:  G_trim_decimal           
  Platform:  All       |         Cpu:  All                      
-----------------------+----------------------------------------------------
Comment (by hamish):

 comments?

 {{{
 Index: lib/gis/trim_dec.c
 ===================================================================
 --- lib/gis/trim_dec.c  (revision 38754)
 +++ lib/gis/trim_dec.c  (working copy)
 @@ -14,6 +14,7 @@
   * \date 1999-2008
   */

 +#include <string.h>
  #include <grass/gis.h>


 @@ -30,6 +31,10 @@
  {
      char *mark;

 +    /* don't trim e+20 into e+2 */
 +    if( strchr(buf, 'e') || strchr(buf, 'E') )
 +       return 0;
 +
      /* find the . */
      while (*buf != '.')
         if (*buf++ == 0)
 }}}



 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/720#comment:1>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list