mirror of
https://github.com/btdig/dhtcrawler2.git
synced 2025-02-07 13:59:08 +00:00
torbuilder(importer) fix badarith bug when there're invalid name torrent
files
This commit is contained in:
parent
ae9f2f0c8e
commit
f776cbbc46
@ -94,13 +94,15 @@ parse_hash(FileName) ->
|
|||||||
|
|
||||||
append_torrent_names(FP, [Name|Rest]) ->
|
append_torrent_names(FP, [Name|Rest]) ->
|
||||||
Hash = parse_hash(Name),
|
Hash = parse_hash(Name),
|
||||||
case length(Hash) == 40 of
|
This = case length(Hash) == 40 of
|
||||||
true ->
|
true ->
|
||||||
io:format(FP, "~s~n", [Name]) ,
|
io:format(FP, "~s~n", [Name]),
|
||||||
1 + append_torrent_names(FP, Rest);
|
1;
|
||||||
false ->
|
false ->
|
||||||
?W(?FMT("invalid torrent file name ~s", [Name]))
|
?W(?FMT("invalid torrent file name ~s", [Name])),
|
||||||
end;
|
0
|
||||||
|
end,
|
||||||
|
This + append_torrent_names(FP, Rest);
|
||||||
|
|
||||||
append_torrent_names(_, []) ->
|
append_torrent_names(_, []) ->
|
||||||
0.
|
0.
|
||||||
|
Loading…
Reference in New Issue
Block a user