summaryrefslogtreecommitdiff
path: root/dd.c
diff options
context:
space:
mode:
authorEric Andersen1999-12-09 06:11:36 +0000
committerEric Andersen1999-12-09 06:11:36 +0000
commit1792f8c48926450501e19d32e78e140bcb9661c6 (patch)
tree14d0304ebb774077e696a9c86117bf43d935d8bb /dd.c
parentc24db7b591870978fdd2cec8995728d1520c2fa9 (diff)
downloadbusybox-1792f8c48926450501e19d32e78e140bcb9661c6.zip
busybox-1792f8c48926450501e19d32e78e140bcb9661c6.tar.gz
Tail now works (costs 6k). Several other updates.
-Erik
Diffstat (limited to 'dd.c')
-rw-r--r--dd.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/dd.c b/dd.c
index b370387..90c1004 100644
--- a/dd.c
+++ b/dd.c
@@ -48,54 +48,10 @@ static const char dd_usage[] =
"\tcount=n\tcopy only n input blocks\n"
//"\tskip=n\tskip n input blocks\n"
"\n"
-"BYTES may be suffixed: by k for x1024, b for x512, and w for x2.\n";
+"BYTES may be suffixed by w (x2), k (x1024), b (x512), or m (x1024^2).\n";
-
-/*
- * Read a number with a possible multiplier.
- * Returns -1 if the number format is illegal.
- */
-static long getNum (const char *cp)
-{
- long value;
-
- if (!isDecimal (*cp))
- return -1;
-
- value = 0;
-
- while (isDecimal (*cp))
- value = value * 10 + *cp++ - '0';
-
- switch (*cp++) {
- case 'k':
- value *= 1024;
- break;
-
- case 'b':
- value *= 512;
- break;
-
- case 'w':
- value *= 2;
- break;
-
- case '\0':
- return value;
-
- default:
- return -1;
- }
-
- if (*cp)
- return -1;
-
- return value;
-}
-
-
extern int dd_main (int argc, char **argv)
{
const char *inFile = NULL;