See ChangeLog entry 2004-04-09 15:00 UTC-0500 David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
2004-04-09 18:54:53 +00:00
parent 00d4fb45e1
commit e39f835bc4
3 changed files with 30 additions and 16 deletions

View File

@@ -8,6 +8,18 @@
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2004-04-09 15:00 UTC-0500 David G. Holm <dholm@jsd-llc.com>
* source/rdd/dbfntx/dbfntx1.c
! Converted first parameter in the call to hb_fsCreateTemp from "" to
NULL in order to avoid having to provide a (BYTE *) type conversion
like the one that I added for the second parameter.
* source/rtl/fstemp.c
* Reformatted the code to match the Harbour coding style (in particular,
to use spaces instead of Tabs for indenting and to always use braces
for a code block that follows an if statement, even if only one line).
! Added a null pointer check in the non-Unix code that checks the size
of the input arguments.
2004-04-09 11:45 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
* source/debug/debugger.prg
* removed diagnostic ALERT call

View File

@@ -2524,7 +2524,7 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex )
if( nParts == 1 )
{
BYTE TempName[ _POSIX_PATH_MAX ];
sortInfo.tempHandle = hb_fsCreateTemp( "", "SORT-TMP", FC_NORMAL, TempName );
sortInfo.tempHandle = hb_fsCreateTemp( NULL, ( BYTE * ) "SORT-TMP", FC_NORMAL, TempName );
if( sortInfo.tempHandle == FS_ERROR )
hb_errInternal( HB_EI_ERRUNRECOV, "Cannot create temp file", "hb_ntxIndexCreate", NULL );
}

View File

@@ -113,16 +113,16 @@ FHANDLE hb_fsCreateTemp( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiA
}
}
#else
if( (strlen(pszDir)+strlen(pszPrefix)+6) < _POSIX_PATH_MAX )
{
FHANDLE fhnd;
char cTemplate[_POSIX_PATH_MAX];
if( ( ( pszDir ? strlen( pszDir ) : 0 ) + ( pszPrefix ? strlen( pszPrefix ) : 0 ) + 6 ) < _POSIX_PATH_MAX )
{
FHANDLE fhnd;
char cTemplate[_POSIX_PATH_MAX];
pszName[0] = '\0';
cTemplate[0] = '\0';
cTemplate[0] = '\0';
if( pszDir )
{
int nLen;
strcpy( cTemplate, pszDir );
strcpy( cTemplate, pszDir );
nLen = strlen( cTemplate );
if( cTemplate[nLen] != hb_set.HB_SET_DIRSEPARATOR )
{
@@ -131,18 +131,20 @@ FHANDLE hb_fsCreateTemp( const BYTE * pszDir, const BYTE * pszPrefix, USHORT uiA
}
}
if( pszPrefix )
strcat( cTemplate, pszPrefix );
strcat( cTemplate, "XXXXXX" ); /* required by mkstemp */
while( --nAttemptLeft )
{
fhnd = mkstemp( cTemplate );
if( fhnd >= 0 )
{
strcat( cTemplate, pszPrefix );
}
strcat( cTemplate, "XXXXXX" ); /* required by mkstemp */
while( --nAttemptLeft )
{
fhnd = mkstemp( cTemplate );
if( fhnd >= 0 )
{
strcpy( pszName, cTemplate );
return fhnd;
return fhnd;
}
}
}
}
}
#endif
hb_fsSetError( FS_ERROR );