Commit 081977ba6183240d9de1d13b79e5cabf33a93c0a

Thomas de Grivel 2022-03-20T10:31:50

fix size binary

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/size.c b/size.c
index 37c0852..bdd49f2 100644
--- a/size.c
+++ b/size.c
@@ -42,6 +42,7 @@ int main (int argc, char **argv)
     if (fwrite(buf, r, 1, pipe) != 1)
       err(1, "fwrite");
     pos += r;
+    len = pos + BUFSIZE < size ? BUFSIZE : size - pos;
   }
   if (r < 0)
       err(1, "fread");