From: Matt Joiner Date: Wed, 13 May 2020 07:32:16 +0000 (+1000) Subject: Fix Client torrent "of %d bytes" in status X-Git-Tag: v1.16.0~27 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=461403c0f506bae01304ac3faee34fe6ba4edf48;p=btrtrc.git Fix Client torrent "of %d bytes" in status --- diff --git a/client.go b/client.go index 41645367..ebbf21b3 100644 --- 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("") }