diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-08-20 12:45:05 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-08-20 12:45:05 +0200 |
commit | 1b57fe108f082167fd85a5962769a941ba871dd4 (patch) | |
tree | 1b3d90f181d0e8a212d1e9e4b1bcc05b77c11667 /coreutils | |
parent | f3114a3bd0d468a417e9e4a254d76ecf1cf35178 (diff) | |
download | busybox-1b57fe108f082167fd85a5962769a941ba871dd4.tar.gz |
dd: code shrink
function old new delta
dd_main 1487 1475 -12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 4 |
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) { |