about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-12-06T10·35+0100
committerDaiderd Jordan <daiderd@gmail.com>2017-12-06T10·41+0100
commit2cb8aaa6109b4f5a31a1091dc3f56c8059a9c2c1 (patch)
tree7925debcde02ab10316238399596062fe09acd98 /src
parent11a7f8ce14afbdc60b9acf424d941ccda1adc141 (diff)
ssh-store: fix length when writing nar
This fixes nix copy and other things that use copyStorePath.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/ssh-store.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc
index bb536fadfd51..107c6e1ecb4d 100644
--- a/src/libstore/ssh-store.cc
+++ b/src/libstore/ssh-store.cc
@@ -62,9 +62,9 @@ public:
     ForwardSource(Source & readSource, Sink & writeSink) : readSource(readSource), writeSink(writeSink) {}
     size_t read(unsigned char * data, size_t len) override
     {
-        auto res = readSource.read(data, len);
-        writeSink(data, len);
-        return res;
+        auto n = readSource.read(data, len);
+        writeSink(data, n);
+        return n;
     }
 };