diff options
author | Ron Yorston <rmy@pobox.com> | 2018-03-01 15:37:12 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-03-01 15:37:12 +0000 |
commit | 5b726f8a78c33e117c2a968739b1b4a6964905f8 (patch) | |
tree | af063c6bf3e99b7480c2fad2dffc2a76c09cb5e0 /coreutils/od_bloaty.c | |
parent | 5f8dac68690e92f0be220f8f8d9f797a2aedc806 (diff) | |
parent | cc222747ae7e264cbe9b1c8a9c253860275db8a9 (diff) | |
download | busybox-w32-5b726f8a78c33e117c2a968739b1b4a6964905f8.tar.gz busybox-w32-5b726f8a78c33e117c2a968739b1b4a6964905f8.tar.bz2 busybox-w32-5b726f8a78c33e117c2a968739b1b4a6964905f8.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'coreutils/od_bloaty.c')
-rw-r--r-- | coreutils/od_bloaty.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 645a05f57..75e14ef7d 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
@@ -218,7 +218,14 @@ struct globals { | |||
218 | 218 | ||
219 | bool not_first; | 219 | bool not_first; |
220 | bool prev_pair_equal; | 220 | bool prev_pair_equal; |
221 | |||
222 | char address_fmt[sizeof("%0n"OFF_FMT"xc")]; | ||
221 | } FIX_ALIASING; | 223 | } FIX_ALIASING; |
224 | /* Corresponds to 'x' above */ | ||
225 | #define address_base_char G.address_fmt[sizeof(G.address_fmt)-3] | ||
226 | /* Corresponds to 'n' above */ | ||
227 | #define address_pad_len_char G.address_fmt[2] | ||
228 | |||
222 | #if !ENABLE_LONG_OPTS | 229 | #if !ENABLE_LONG_OPTS |
223 | enum { G_pseudo_offset = 0 }; | 230 | enum { G_pseudo_offset = 0 }; |
224 | #endif | 231 | #endif |
@@ -227,6 +234,7 @@ enum { G_pseudo_offset = 0 }; | |||
227 | setup_common_bufsiz(); \ | 234 | setup_common_bufsiz(); \ |
228 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ | 235 | BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ |
229 | G.bytes_per_block = 32; \ | 236 | G.bytes_per_block = 32; \ |
237 | strcpy(G.address_fmt, "%0n"OFF_FMT"xc"); \ | ||
230 | } while (0) | 238 | } while (0) |
231 | 239 | ||
232 | 240 | ||
@@ -851,18 +859,12 @@ format_address_none(off_t address UNUSED_PARAM, char c UNUSED_PARAM) | |||
851 | { | 859 | { |
852 | } | 860 | } |
853 | 861 | ||
854 | static char address_fmt[] ALIGN1 = "%0n"OFF_FMT"xc"; | ||
855 | /* Corresponds to 'x' above */ | ||
856 | #define address_base_char address_fmt[sizeof(address_fmt)-3] | ||
857 | /* Corresponds to 'n' above */ | ||
858 | #define address_pad_len_char address_fmt[2] | ||
859 | |||
860 | static void | 862 | static void |
861 | format_address_std(off_t address, char c) | 863 | format_address_std(off_t address, char c) |
862 | { | 864 | { |
863 | /* Corresponds to 'c' */ | 865 | /* Corresponds to 'c' */ |
864 | address_fmt[sizeof(address_fmt)-2] = c; | 866 | G.address_fmt[sizeof(G.address_fmt)-2] = c; |
865 | printf(address_fmt, address); | 867 | printf(G.address_fmt, address); |
866 | } | 868 | } |
867 | 869 | ||
868 | #if ENABLE_LONG_OPTS | 870 | #if ENABLE_LONG_OPTS |