aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/dd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c
index e046ff5cc..9299f58bc 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -363,13 +363,13 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
}
if (skip) {
if (lseek(ifd, skip * ibs, SEEK_CUR) < 0) {
- while (skip-- > 0) {
+ do {
ssize_t n = safe_read(ifd, ibuf, ibs);
if (n < 0)
goto die_infile;
if (n == 0)
break;
- }
+ } while (--skip != 0);
}
}
if (seek) {