]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix Client torrent "of %d bytes" in status
authorMatt Joiner <anacrolix@gmail.com>
Wed, 13 May 2020 07:32:16 +0000 (17:32 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 13 May 2020 07:32:16 +0000 (17:32 +1000)
client.go

index 416453677c14b6d5a4dfa4ddb82f7d5a7f6b8067..ebbf21b38e7b4ebe161e91ea6a154fd2b538b4cd 100644 (file)
--- a/client.go
+++ b/client.go
@@ -140,7 +140,12 @@ func (cl *Client) WriteStatus(_w io.Writer) {
                }
                fmt.Fprint(w, "\n")
                if t.info != nil {
-                       fmt.Fprintf(w, "%f%% of %d bytes (%s)", 100*(1-float64(t.bytesMissingLocked())/float64(t.info.TotalLength())), t.length, humanize.Bytes(uint64(t.info.TotalLength())))
+                       fmt.Fprintf(
+                               w,
+                               "%f%% of %d bytes (%s)",
+                               100*(1-float64(t.bytesMissingLocked())/float64(t.info.TotalLength())),
+                               *t.length,
+                               humanize.Bytes(uint64(*t.length)))
                } else {
                        w.WriteString("<missing metainfo>")
                }