summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-04-20 05:38:56 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-04-20 10:38:56 +0800
commitbb14c97d406e5ed49863c666897da890e600a3f3 (patch)
tree957ebcf35eb8ced70a8c3fe523037f8d0d8f6ff4 /routers/repo
parentfa2a513c62910c133316472247121c5c562eaf60 (diff)
downloadgitea-bb14c97d406e5ed49863c666897da890e600a3f3.tar.gz
gitea-bb14c97d406e5ed49863c666897da890e600a3f3.zip
Fix empty file download (#1506)
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/download.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index 85e9fc64c9..8b1bb7f952 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -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]
}