From 2cb8aaa6109b4f5a31a1091dc3f56c8059a9c2c1 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Wed, 6 Dec 2017 11:35:24 +0100 Subject: [PATCH] ssh-store: fix length when writing nar This fixes nix copy and other things that use copyStorePath. --- src/libstore/ssh-store.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index bb536fadf..107c6e1ec 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; } };