1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-26 09:09:36 -05:00

Fix empty file download (#1506)

This commit is contained in:
Lauris BH 2017-04-20 05:38:56 +03:00 committed by Lunny Xiao
parent fa2a513c62
commit bb14c97d40

View file

@ -19,7 +19,7 @@ import (
func ServeData(ctx *context.Context, name string, reader io.Reader) error {
buf := make([]byte, 1024)
n, _ := reader.Read(buf)
if n > 0 {
if n >= 0 {
buf = buf[:n]
}