Przemek,

The return value does not include the terminating null byte in the count.
...
         if( c != 0 ) ++size;
      }
      while( c != 0 );
...
        
I made a few tests with BCC and Spd add #define snprintf hb_snprintf_c
and the basics are working but with differences in accuracy.

? Sql_sprintf( "Phi = %.15f", (1 + 5**0.5) / 2 ) )

Phi = 1.618033988749895 snprintf() it's Ok
Phi = 1.618033981323242 hb_snprintf_c()

Best regards,
Xavi

Przemyslaw Czerpak escribió:
On Mon, 26 Jan 2009, Xavi wrote:

Hi Xavi,

stdint.h is C99, Does not exist in many compilers as BCC 5.5

Yes, I know.

As far I know hbmisc/spd.c is 100% compatible with sprintf() C99 and adds new 
features.
It was allowed me, move C/C++ solutions to Harbour applications.
Of course, using C RTL snprintf().

And this is exactly what we want to eliminate. The code I sent is
snprintf() replacement.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour





_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to