Subtract the amount we actually read, not what we asked for.
---
 toys/pending/dd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From f758db18d106387f285e5e9d826d4cb353997d06 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Wed, 14 Aug 2019 21:31:36 -0700
Subject: [PATCH] dd: fix skip= with short reads.

Subtract the amount we actually read, not what we asked for.
---
 toys/pending/dd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/pending/dd.c b/toys/pending/dd.c
index 80a7595f..5b624fd7 100644
--- a/toys/pending/dd.c
+++ b/toys/pending/dd.c
@@ -212,7 +212,7 @@ void dd_main()
           xprintf("%s: Can't skip\n", TT.in.name);
           return;
         }
-        off -= chunk;
+        off -= n;
       }
     }
   }
-- 
2.23.0.rc1.153.gdeed80330f-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to