See ChangeLog entry 2004-05-06 21:10 UTC-0400 David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
2004-05-07 01:16:25 +00:00
parent 070e6a9f88
commit fccc74ef54
2 changed files with 14 additions and 1 deletions

View File

@@ -8,6 +8,11 @@
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2004-05-06 21:10 UTC-0400 David G. Holm <dholm@jsd-llc.com>
* source/vm/itemapi.c
! The funtion snprintf is not a Standard C function and does not
exist in the Version 12 of the Microsoft C++ compiler (MSVC 6).
2004-05-06 18:00 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
+ CVSROOT/avail
* CVSROOT/checkoutlist

View File

@@ -1410,14 +1410,22 @@ char * HB_EXPORT hb_itemString( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq )
case HB_IT_POINTER:
{
#ifdef _MSC_VER
int size = 16; /* 8 bytes for address + 0x + \0 + padding (no snprintf function) */
#else
int size = 11; /* 8 bytes for address + 0x + \0 */
#endif
int n;
BOOL bFail = TRUE;
buffer = ( char * ) hb_xgrab( size );
do
{
#ifdef _MSC_VER
n = sprintf( buffer, "%p", hb_itemGetPtr( pItem ) );
#else
n = snprintf( buffer, size, "%p", hb_itemGetPtr( pItem ) );
#endif
if( (n > -1) && (n < size) )
{
bFail = FALSE;
@@ -1428,7 +1436,7 @@ char * HB_EXPORT hb_itemString( PHB_ITEM pItem, ULONG * ulLen, BOOL * bFreeReq )
size = n + 1;
else
size *= 2;
buffer = hb_xrealloc( buffer, size );
buffer = ( char * ) hb_xrealloc( buffer, size );
}
}
while( bFail );