make tr_torrentStat() const.

malloc, rather than calloc, the buffer in strndup.
This commit is contained in:
Charles Kerr
2007-07-15 19:12:54 +00:00
parent 4a0c4b6fbc
commit 321b01d430
5 changed files with 25 additions and 27 deletions

View File

@@ -399,10 +399,12 @@ char*
tr_strndup( const char * in, int len )
{
char * out = NULL;
if( in != NULL )
{
out = tr_calloc( len+1, 1 );
out = tr_malloc( len+1 );
memcpy( out, in, len );
out[len] = '\0';
}
return out;
}