summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pkg/io/ioutil/ioutil.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/io/ioutil/ioutil.go b/src/pkg/io/ioutil/ioutil.go
index 65f457b24..ebdcf224f 100644
--- a/src/pkg/io/ioutil/ioutil.go
+++ b/src/pkg/io/ioutil/ioutil.go
@@ -31,7 +31,7 @@ func ReadFile(filename string) ([]byte, os.Error) {
// read, so let's try it but be prepared for the answer to be wrong.
dir, err := f.Stat()
var n uint64
- if err != nil && dir.Size < 2e9 { // Don't preallocate a huge buffer, just in case.
+ if err == nil && dir.Size < 2e9 { // Don't preallocate a huge buffer, just in case.
n = dir.Size
}
// Add a little extra in case Size is zero, and to avoid another allocation after