(libT) add some extra gcc safeguards. fix a couple of compiler warnings in makemeta

This commit is contained in:
Charles Kerr 2008-10-22 17:14:50 +00:00
parent 84dcaab5f4
commit fc99ff6881
3 changed files with 10 additions and 6 deletions

View File

@ -15,6 +15,8 @@
#include <inttypes.h>
#include <libtransmission/utils.h> /* TR_GNUC_NULL_TERMINATED */
/**
***
**/
@ -73,7 +75,7 @@ void tr_cryptoEncrypt( tr_crypto * crypto,
void tr_sha1( uint8_t * setme,
const void * content1,
int content1_len,
... );
... ) TR_GNUC_NULL_TERMINATED;
/** Returns a random number in the range of [0...n) */

View File

@ -215,8 +215,9 @@ getHashInfo( tr_metainfo_builder * b )
if( !fp )
{
b->my_errno = errno;
tr_snprintf( b->errfile, sizeof( b->errfile ),
b->files[fileIndex].filename );
tr_strlcpy( b->errfile,
b->files[fileIndex].filename,
sizeof( b->errfile ) );
b->result = TR_MAKEMETA_IO_READ;
tr_free( buf );
tr_free( ret );
@ -250,8 +251,9 @@ getHashInfo( tr_metainfo_builder * b )
if( !fp )
{
b->my_errno = errno;
tr_snprintf( b->errfile, sizeof( b->errfile ),
b->files[fileIndex].filename );
tr_strlcpy( b->errfile,
b->files[fileIndex].filename,
sizeof( b->errfile ) );
b->result = TR_MAKEMETA_IO_READ;
tr_free( buf );
tr_free( ret );

View File

@ -258,7 +258,7 @@ size_t tr_strlcpy( char * dst,
int tr_snprintf( char * buf,
size_t buflen,
const char * fmt,
... );
... ) TR_GNUC_PRINTF( 3, 4 );
const char* tr_strerror( int );