aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-10-15 12:31:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-10-15 12:31:54 +0200
commit37a9008f8e82b9469062f5a792a26f145012c617 (patch)
tree251c65d2bd48fd5fb587bfe87b7badd6405ca66f
parented79af77a4791aa0bbcb0a8d1b4c03ccf313fa94 (diff)
downloadbusybox-w32-37a9008f8e82b9469062f5a792a26f145012c617.tar.gz
busybox-w32-37a9008f8e82b9469062f5a792a26f145012c617.tar.bz2
busybox-w32-37a9008f8e82b9469062f5a792a26f145012c617.zip
brctl: code shrink
function old new delta show_bridge 323 317 -6 brctl_main 2171 2164 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-13) Total: -13 bytes text data bss dec hex filename 1002083 551 5612 1008246 f6276 busybox_old 1002065 551 5612 1008228 f6264 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/brctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/brctl.c b/networking/brctl.c
index 8ed9d2096..25640246d 100644
--- a/networking/brctl.c
+++ b/networking/brctl.c
@@ -157,7 +157,8 @@ static int show_bridge(const char *name, int need_hdr)
157 strcpy(filedata, "yes"); 157 strcpy(filedata, "yes");
158 fputs(filedata, stdout); 158 fputs(filedata, stdout);
159 159
160 strcpy(sfx - (sizeof("bridge/")-1), "brif"); 160 /* sfx points past "BR/bridge/", turn it into "BR/brif": */
161 sfx[-4] = 'f'; sfx[-3] = '\0';
161 tabs = 0; 162 tabs = 0;
162 ifaces = opendir(pathbuf); 163 ifaces = opendir(pathbuf);
163 if (ifaces) { 164 if (ifaces) {
@@ -472,8 +473,8 @@ static void show_bridge_stp(const char *name)
472 { 473 {
473 DIR *ifaces; 474 DIR *ifaces;
474 475
475 /* sfx points past "BR/bridge/", turn it to "BR/brif": */ 476 /* sfx points past "BR/bridge/", turn it into "BR/brif": */
476 strcpy(sfx - 4, "f"); 477 sfx[-4] = 'f'; sfx[-3] = '\0';
477 ifaces = opendir(pathbuf); 478 ifaces = opendir(pathbuf);
478 if (ifaces) { 479 if (ifaces) {
479 struct dirent *ent; 480 struct dirent *ent;