mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
Fix writing miscellaneous bytes after EOF
This commit is contained in:
parent
7472b754bf
commit
d158c2776e
@ -84,18 +84,15 @@ func copyContent(reader *bufio.Reader, writer *bufio.Writer, blockSize uint) {
|
|||||||
for {
|
for {
|
||||||
n, err := reader.Read(p)
|
n, err := reader.Read(p)
|
||||||
|
|
||||||
if err != nil {
|
if err == nil || err == io.EOF {
|
||||||
if err == io.EOF {
|
|
||||||
writer.Write(p[0:n])
|
writer.Write(p[0:n])
|
||||||
sz += int64(n)
|
sz += int64(n)
|
||||||
break
|
if err == io.EOF {
|
||||||
} else {
|
|
||||||
fmt.Println("An error occurred during content copy. Aborting")
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
writer.Write(p)
|
fmt.Println("An error occurred during content copy. Aborting")
|
||||||
sz += int64(blockSize) * 4096
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Wrote %d bytes\r", sz)
|
fmt.Printf("Wrote %d bytes\r", sz)
|
||||||
|
Loading…
Reference in New Issue
Block a user