1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

(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 <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, void tr_sha1( uint8_t * setme,
const void * content1, const void * content1,
int content1_len, int content1_len,
... ); ... ) TR_GNUC_NULL_TERMINATED;
/** Returns a random number in the range of [0...n) */ /** Returns a random number in the range of [0...n) */

View file

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

View file

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