summaryrefslogtreecommitdiffstats
path: root/bin/dd
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-09-16 05:12:59 +0000
committergreen <green@FreeBSD.org>1999-09-16 05:12:59 +0000
commit4e25c183b590c314cf2ac9917980b5197ef69ae8 (patch)
tree0e678e509ea9114202673804f67752d1635492b6 /bin/dd
parent491fc39d0f91e9f69371c986eb51930ad95896b2 (diff)
downloadFreeBSD-src-4e25c183b590c314cf2ac9917980b5197ef69ae8.zip
FreeBSD-src-4e25c183b590c314cf2ac9917980b5197ef69ae8.tar.gz
Let count=-something fail, while count=0 may succeed, thus making dd(1)
useful as a seeking-tool as well as its many other uses. Previously, dd(1) would succeed with count=0, but wouldn't get to the point that blocks were to be read/written. This is a more useful behavior, and this specific case doesn't seem to be handled by POSIX.
Diffstat (limited to 'bin/dd')
-rw-r--r--bin/dd/args.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c
index 48b2063..7348503 100644
--- a/bin/dd/args.c
+++ b/bin/dd/args.c
@@ -207,8 +207,8 @@ f_count(arg)
{
cpy_cnt = get_num(arg);
- if (!cpy_cnt)
- terminate(0);
+ if (cpy_cnt < 0)
+ errx(1, "count cannot be negative");
}
static void
OpenPOWER on IntegriCloud