Changeset 9774
- Timestamp:
- Dec 15, 2009, 4:34:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent-magnet.c
r9772 r9774 108 108 if( fp != NULL ) 109 109 { 110 const int o ffset= piece * METADATA_PIECE_SIZE;111 112 if( !fseek( fp, tor->infoDictOffset + o ffset, SEEK_SET ) )110 const int o = piece * METADATA_PIECE_SIZE; 111 112 if( !fseek( fp, tor->infoDictOffset + o, SEEK_SET ) ) 113 113 { 114 const int l = o ffset+ METADATA_PIECE_SIZE <= tor->infoDictLength114 const int l = o + METADATA_PIECE_SIZE <= tor->infoDictLength 115 115 ? METADATA_PIECE_SIZE 116 : tor->infoDictLength - offset; 117 char * buf = tr_new( char, l ); 118 const int n = fread( buf, 1, l, fp ); 119 if( n != l ) 116 : tor->infoDictLength - o; 117 118 if( 0<l && l<=METADATA_PIECE_SIZE ) 120 119 { 121 *len = l; 122 ret = buf; 123 buf = NULL; 120 char * buf = tr_new( char, l ); 121 const int n = fread( buf, 1, l, fp ); 122 if( n == l ) 123 { 124 *len = l; 125 ret = buf; 126 buf = NULL; 127 } 128 129 tr_free( buf ); 124 130 } 125 126 tr_free( buf );127 131 } 128 132
Note: See TracChangeset
for help on using the changeset viewer.