[grisbi-cvs] grisbi/src gsb_real.c,1.67,1.68

Pierre Biava pbiava at users.sourceforge.net
Thu Jan 28 22:53:44 CET 2010


Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8728

Modified Files:
	gsb_real.c 
Log Message:
bug fix 862

Index: gsb_real.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_real.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- gsb_real.c	27 Jan 2010 22:44:43 -0000	1.67
+++ gsb_real.c	28 Jan 2010 21:53:42 -0000	1.68
@@ -149,11 +149,6 @@
     const gchar *cs_end;
 	ldiv_t units;
 
-	if ( (number.exponent < 0)
-    || (number.exponent > sizeofarray ( gsb_real_power_10 ) )
-    || (number.mantissa == error_real.mantissa) )
-      return g_strdup ( "###ERR###" );
-
     cs_start = (currency_symbol && conv->p_cs_precedes) ? currency_symbol : "";
     cs_start_space = (currency_symbol && conv->p_cs_precedes && conv->p_sep_by_space) ? " " : "";
     sign = (number.mantissa < 0) ? conv->negative_sign : conv->positive_sign;
@@ -287,6 +282,10 @@
         else
             return g_strdup ("0");
     }
+    else if ( (number.exponent < 0)
+    || (number.exponent > sizeofarray ( gsb_real_power_10 ) )
+    || (number.mantissa == error_real.mantissa) )
+        return g_strdup ( "###ERR###" );
 
     /* first we need to adapt the exponent to the currency */
     /* if the exponent of the real is not the same of the currency, need to adapt it */
@@ -457,7 +456,9 @@
 
     if ( !string)
         return error_real;
-//~ printf ("string  = %s\n", string);
+    if ( g_strstr_len ( string, -1, "###ERR###" ) )
+        return error_real;
+
     for ( ; ; )
     {
         if ( g_ascii_isdigit ( *p ) )



More information about the cvs mailing list