Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-05-26 15:46:29 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-05-26 15:46:29 +0300
commit283cba78f2c9ea8478ef58ba616197df31640353 (patch)
treef47301d8ad84ae37c04e2ea9cf5d5f26defa384f /util-linux
parent34751d8bf921a2c07cf9a7ce9074756a3d936013 (diff)
hexdump, xxd: shrink strings
function old new delta add_first 12 10 -2 .rodata 105321 105306 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-17) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/hexdump.c20
-rw-r--r--util-linux/hexdump_xxd.c2
2 files changed, 11 insertions, 11 deletions
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index 307a84803..421fe025d 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -72,14 +72,14 @@ static void bb_dump_addfile(dumper_t *dumper, char *name)
}
static const char *const add_strings[] ALIGN_PTR = {
- "\"%07.7_ax \"16/1 \"%03o \"\"\n\"", /* b */
- "\"%07.7_ax \"16/1 \"%3_c \"\"\n\"", /* c */
- "\"%07.7_ax \"8/2 \" %05u \"\"\n\"", /* d */
- "\"%07.7_ax \"8/2 \" %06o \"\"\n\"", /* o */
- "\"%07.7_ax \"8/2 \" %04x \"\"\n\"", /* x */
+ "\"%07_ax\"16/1 \" %03o\"" "\"\n\"", /* b */
+ "\"%07_ax\"16/1 \" %3_c\"" "\"\n\"", /* c */
+ "\"%07_ax\"8/2 \" %05u\"" "\"\n\"", /* d */
+ "\"%07_ax\"8/2 \" %06o\"" "\"\n\"", /* o */
+ "\"%07_ax\"8/2 \" %04x\"" "\"\n\"", /* x */
};
-static const char add_first[] ALIGN1 = "\"%07.7_Ax\n\"";
+static const char add_first[] ALIGN1 = "\"%07_Ax\n\"";
static const char hexdump_opts[] ALIGN1 = "bcdoxCe:f:n:s:v";
@@ -110,9 +110,9 @@ int hexdump_main(int argc, char **argv)
/* Save a little bit of space below by omitting the 'else's. */
if (ch == 'C') {
hd_applet:
- bb_dump_add(dumper, "\"%08.8_Ax\n\""); // final address line after dump
- //------------------- "address " 8 * "xx " " " 8 * "xx "
- bb_dump_add(dumper, "\"%08.8_ax \"8/1 \"%02x \"\" \"8/1 \"%02x \"");
+ bb_dump_add(dumper, "\"%08_Ax\n\""); // final address line after dump
+ //------------------- "address " 8 * " xx" " " 8 * " xx"
+ bb_dump_add(dumper, "\"%08_ax \"8/1 \" %02x\"\" \"8/1 \" %02x\"");
//------------------- " |ASCII...........|\n"
bb_dump_add(dumper, "\" |\"16/1 \"%_p\"\"|\n\"");
}
@@ -140,7 +140,7 @@ int hexdump_main(int argc, char **argv)
if (!dumper->fshead) {
bb_dump_add(dumper, add_first);
- bb_dump_add(dumper, "\"%07.7_ax \"8/2 \"%04x \"\"\n\"");
+ bb_dump_add(dumper, "\"%07_ax\"8/2 \" %04x\"\"\n\"");
}
argv += optind;
diff --git a/util-linux/hexdump_xxd.c b/util-linux/hexdump_xxd.c
index 9738a76ad..636cbfeec 100644
--- a/util-linux/hexdump_xxd.c
+++ b/util-linux/hexdump_xxd.c
@@ -285,7 +285,7 @@ int xxd_main(int argc UNUSED_PARAM, char **argv)
// output is " 0xXX, 0xXX, 0xXX...", add leading space
bb_dump_add(dumper, "\" \"");
} else
- bb_dump_add(dumper, "\"%08.8_ax: \""); // "address: "
+ bb_dump_add(dumper, "\"%08_ax: \""); // "address: "
}
if (bytes < 1 || bytes >= cols) {