summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-10-06 22:31:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-10-06 22:31:55 +0000
commit6ccb240d6a9a7f777d18848495902ed8c1f773cb (patch)
tree2963faf7c0e3554baac76fda401aff7b8b25a0b4
parentfc9af8adc62a8d7b4f35df6919d611a8d133975b (diff)
Fix ``echo foo |dd'' which was broken by the last commit.
-rw-r--r--bin/dd/args.c7
-rw-r--r--bin/dd/dd.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c
index ed3522cd647..c04c07a1be6 100644
--- a/bin/dd/args.c
+++ b/bin/dd/args.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: args.c,v 1.10 2001/10/04 20:32:27 millert Exp $ */
+/* $OpenBSD: args.c,v 1.11 2001/10/06 22:31:54 millert Exp $ */
/* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: args.c,v 1.10 2001/10/04 20:32:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: args.c,v 1.11 2001/10/06 22:31:54 millert Exp $";
#endif
#endif /* not lint */
@@ -211,7 +211,8 @@ f_count(arg)
char *arg;
{
- cpy_cnt = get_bsz(arg);
+ if ((cpy_cnt = get_bsz(arg)) == 0)
+ cpy_cnt = (size_t)-1;
}
static void
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 03176396cd6..a849ef2a626 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dd.c,v 1.10 2001/10/04 20:32:27 millert Exp $ */
+/* $OpenBSD: dd.c,v 1.11 2001/10/06 22:31:54 millert Exp $ */
/* $NetBSD: dd.c,v 1.6 1996/02/20 19:29:06 jtc Exp $ */
/*-
@@ -48,7 +48,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: dd.c,v 1.10 2001/10/04 20:32:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: dd.c,v 1.11 2001/10/06 22:31:54 millert Exp $";
#endif
#endif /* not lint */
@@ -97,7 +97,7 @@ main(argc, argv)
atexit(summary);
- if (cpy_cnt > 0) {
+ if (cpy_cnt != (size_t)-1) {
while (files_cnt--)
dd_in();
}