summaryrefslogtreecommitdiff
path: root/unxml.go
diff options
context:
space:
mode:
Diffstat (limited to 'unxml.go')
-rw-r--r--unxml.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/unxml.go b/unxml.go
index 473fe9e..f2c970a 100644
--- a/unxml.go
+++ b/unxml.go
@@ -142,12 +142,12 @@ func (r *ElementReader) Read(out []byte) (int, error) {
if lenlr < lenout {
n = copy(out[0:], r.xr.lastread)
r.xr.count += n
- r.xr.lastread = make([]byte, len(out))
lenout -= n
+ r.xr.lastread = make([]byte, 0, lenout)
} else {
n = copy(out[0:], r.xr.lastread[:lenout])
r.xr.lastread = r.xr.lastread[lenout:]
- return r.xr.count, err
+ return n, err
}
}