aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/editor.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/editor.go')
-rw-r--r--routers/web/repo/editor.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go
index 1d18bfe9a9..f272583499 100644
--- a/routers/web/repo/editor.go
+++ b/routers/web/repo/editor.go
@@ -118,7 +118,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
ctx.Data["FileName"] = blob.Name()
buf := make([]byte, 1024)
- n, _ := dataRc.Read(buf)
+ n, _ := util.ReadAtMost(dataRc, buf)
buf = buf[:n]
// Only some file types are editable online as text.
@@ -751,7 +751,7 @@ func UploadFileToServer(ctx *context.Context) {
defer file.Close()
buf := make([]byte, 1024)
- n, _ := file.Read(buf)
+ n, _ := util.ReadAtMost(file, buf)
if n > 0 {
buf = buf[:n]
}