Skip to content

Commit

Permalink
messageWriter: don't ignore error in writeString
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptix committed Jul 31, 2018
1 parent c55e3fb commit c0ce830
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion writeto.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ func (w *messageWriter) Write(p []byte) (int, error) {
}

func (w *messageWriter) writeString(s string) {
n, _ := io.WriteString(w.w, s)
if w.err != nil { // do nothing when in error
return
}
var n int
n, w.err = io.WriteString(w.w, s)
w.n += int64(n)
}

Expand Down

0 comments on commit c0ce830

Please sign in to comment.