X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Fdd.c;h=347a19454ecd9cf3a1dd1a70c10586c1e65de695;hb=8d0e0cdadf726beab28ccdc7d69738c1534e1f74;hp=f1e63fd8bade27acd3ed4d89dfbbb0867b476aeb;hpb=8131eea3dce5fba0dfb78e6083d1730423fad20b;p=oweals%2Fbusybox.git diff --git a/coreutils/dd.c b/coreutils/dd.c index f1e63fd8b..347a19454 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -5,7 +5,7 @@ * * Copyright (C) 2000,2001 Matt Kraai * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" @@ -24,7 +24,7 @@ static const struct suffix_mult dd_suffixes[] = { { "b", 512 }, { "kD", 1000 }, { "k", 1024 }, - { "K", 1024 }, /* compat with coreutils dd */ + { "K", 1024 }, /* compat with coreutils dd */ { "MD", 1000000 }, { "M", 1048576 }, { "GD", 1000000000 }, @@ -38,7 +38,7 @@ struct globals { unsigned long long total_bytes; unsigned long long begin_time_us; #endif -}; +} FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) #define INIT_G() do { \ /* we have to zero it out because of NOEXEC */ \ @@ -301,9 +301,12 @@ int dd_main(int argc UNUSED_PARAM, char **argv) if (ftruncate(ofd, seek * obs) < 0) { struct stat st; - if (fstat(ofd, &st) < 0 || S_ISREG(st.st_mode) || - S_ISDIR(st.st_mode)) + if (fstat(ofd, &st) < 0 + || S_ISREG(st.st_mode) + || S_ISDIR(st.st_mode) + ) { goto die_outfile; + } } } } else {