[hackers] [ubase] dd: allow count=0 || Eivind Uggedal

From: <git_AT_suckless.org>
Date: Wed, 16 Mar 2016 11:18:16 +0100 (CET)

commit c64b5b04c7993765ab67207e86db92a48d7087f4
Author: Eivind Uggedal <eivind_AT_uggedal.com>
AuthorDate: Tue Mar 15 20:16:05 2016 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Mar 16 10:17:51 2016 +0000

    dd: allow count=0

diff --git a/dd.c b/dd.c
index 07fdbc9..1e1fda1 100644
--- a/dd.c
+++ b/dd.c
_AT_@ -126,7 +126,7 @@ prepare_copy(struct dd_config *ddc, int *ifd, int *ofd)
         ddc->count *= ddc->bs;
 
         /* If no count is given, its the filesize minus skip offset */
- if (ddc->count == 0)
+ if (ddc->count == (uint64_t) -1)
                 ddc->count = ddc->fsize - ddc->skip;
 
         return 0;
_AT_@ -243,6 +243,7 @@ main(int argc, char *argv[])
         config.bs = 1<<16;
         config.in = NULL;
         config.out = NULL;
+ config.count = (uint64_t) -1;
 
         /* emulate 'dd' argument parsing */
         for (i = 1; i < argc; ++i) {
Received on Wed Mar 16 2016 - 11:18:16 CET

This archive was generated by hypermail 2.3.0 : Wed Mar 16 2016 - 11:24:21 CET