From eed0743d4ef79ea86c263b2d7b56005ab91b5fc5 Mon Sep 17 00:00:00 2001
From: Matt Joiner <anacrolix@gmail.com>
Date: Fri, 10 Nov 2017 23:44:24 +1100
Subject: [PATCH] bencode.scanner.ReadByte returned errors when it shouldn't
 have

---
 bencode/scanner.go | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/bencode/scanner.go b/bencode/scanner.go
index eaf22dd4..967d5a5d 100644
--- a/bencode/scanner.go
+++ b/bencode/scanner.go
@@ -23,11 +23,8 @@ func (me *scanner) ReadByte() (byte, error) {
 		return me.b[0], nil
 	}
 	n, err := me.r.Read(me.b[:])
-	if err != nil {
-		return me.b[0], err
-	}
-	if n != 1 {
-		panic(n)
+	if n == 1 {
+		err = nil
 	}
 	return me.b[0], err
 }
-- 
2.51.0