- Timestamp:
- May 1, 2010, 3:00:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.9x/libtransmission/blocklist.c
r9868 r10604 12 12 13 13 #include <stdio.h> 14 #include <stdlib.h> /* free */14 #include <stdlib.h> /* free() */ 15 15 #include <string.h> 16 16 … … 235 235 FILE * out; 236 236 char * line; 237 int lineCount = 0; 237 int inCount = 0; 238 int outCount = 0; 238 239 const char * err_fmt = _( "Couldn't read \"%1$s\": %2$s" ); 239 240 … … 269 270 struct tr_ip_range range; 270 271 272 ++inCount; 273 271 274 rangeBegin = strrchr( line, ':' ); 272 275 if( !rangeBegin ){ free( line ); continue; } … … 280 283 281 284 if( !tr_pton( rangeBegin, &addr ) ) 282 tr_err( "blocklist skipped invalid address [%s]\n", rangeBegin ); 285 { 286 tr_err( _( "blocklist skipped invalid address at line %d" ), inCount ); 287 free( line ); 288 continue; 289 } 283 290 range.begin = ntohl( addr.addr.addr4.s_addr ); 284 291 285 292 if( !tr_pton( rangeEnd, &addr ) ) 286 tr_err( "blocklist skipped invalid address [%s]\n", rangeEnd ); 293 { 294 tr_err( _( "blocklist skipped invalid address at line %d" ), inCount ); 295 free( line ); 296 continue; 297 } 287 298 range.end = ntohl( addr.addr.addr4.s_addr ); 288 299 … … 297 308 } 298 309 299 ++ lineCount;310 ++outCount; 300 311 } 301 312 302 313 { 303 314 char * base = tr_basename( b->filename ); 304 tr_inf( _( "Blocklist \"%1$s\" updated with %2$'d entries" ), base, lineCount );315 tr_inf( _( "Blocklist \"%1$s\" updated with %2$'d entries" ), base, outCount ); 305 316 tr_free( base ); 306 317 } 307 308 318 309 319 fclose( out ); … … 312 322 blocklistLoad( b ); 313 323 314 return lineCount;315 } 316 324 return outCount; 325 } 326
Note: See TracChangeset
for help on using the changeset viewer.