torrent/builder.go | 4 ++-- diff --git a/torrent/builder.go b/torrent/builder.go index b3db7d41207f4042b9a58570874df93d010d1bd1..20103b60c0903433f1047372059ae553d25562d6 100644 --- a/torrent/builder.go +++ b/torrent/builder.go @@ -127,7 +127,6 @@ file.abspath = f file.splitpath = split_path(f) file.size = fi.Size() batch.files = append(batch.files, file) - batch.TotalSize += file.size } @@ -163,7 +162,8 @@ // and setup the default name batch.DefaultName = common[len(common)-1] lcommon := len(common) - for _, f := range batch.files { + for i := range batch.files { + f := &batch.files[i] f.splitpath = f.splitpath[lcommon:] }