X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=dd.c;h=3f58929ba44f15382a232250158d0e115a8245a1;hb=3a6da8c183142a2681a2382b63e970f457cf807b;hp=582310681eb83f781ee10427f9c62a142fbe2398;hpb=dd19c6990496023fe23fefef8f1798740f7d39c6;p=oweals%2Fbusybox.git diff --git a/dd.c b/dd.c index 582310681..3f58929ba 100644 --- a/dd.c +++ b/dd.c @@ -21,16 +21,16 @@ * */ -#include "busybox.h" - #include #include #include #include #include #include +#include "busybox.h" + -static struct suffix_mult dd_suffixes[] = { +static const struct suffix_mult dd_suffixes[] = { { "c", 1 }, { "w", 2 }, { "b", 512 }, @@ -45,7 +45,7 @@ static struct suffix_mult dd_suffixes[] = { int dd_main(int argc, char **argv) { - int i, ifd, ofd, oflag, sync = FALSE, trunc = TRUE; + int i, ifd, ofd, oflag, sync_flag = FALSE, trunc = TRUE; size_t in_full = 0, in_part = 0, out_full = 0, out_part = 0; size_t bs = 512, count = -1; ssize_t n; @@ -73,7 +73,7 @@ int dd_main(int argc, char **argv) trunc = FALSE; buf += 7; } else if (strncmp("sync", buf, 4) == 0) { - sync = TRUE; + sync_flag = TRUE; buf += 4; } else { error_msg_and_die("invalid conversion `%s'", argv[i]+5); @@ -84,7 +84,7 @@ int dd_main(int argc, char **argv) buf++; } } else - usage(dd_usage); + show_usage(); } buf = xmalloc(bs); @@ -138,7 +138,7 @@ int dd_main(int argc, char **argv) in_full++; else in_part++; - if (sync) { + if (sync_flag) { memset(buf + n, '\0', bs - n); n = bs; }