]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: Make some variables function-local
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Dec 2016 10:39:55 +0000 (11:39 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:07:46 +0000 (14:07 -0800)
addrp_width and screen_width are used in main() only, so no need to have
them globally available.

Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index dcbe3a4b1e2becfd3e36a008f81709fd532e54f9..11101cfb449c2c65cc28d05459e5e61ae27ab974 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -105,10 +105,8 @@ int sctp_ino;
 
 int netid_width;
 int state_width;
-int addrp_width;
 int addr_width;
 int serv_width;
-int screen_width;
 
 static const char *TCP_PROTO = "tcp";
 static const char *SCTP_PROTO = "sctp";
@@ -4018,6 +4016,7 @@ int main(int argc, char *argv[])
        FILE *filter_fp = NULL;
        int ch;
        int state_filter = 0;
+       int addrp_width, screen_width = 80;
 
        while ((ch = getopt_long(argc, argv,
                                 "dhaletuwxnro460spbEf:miA:D:F:vVzZN:KHS",
@@ -4307,7 +4306,6 @@ int main(int argc, char *argv[])
        if (current_filter.states&(current_filter.states-1))
                state_width = 10;
 
-       screen_width = 80;
        if (isatty(STDOUT_FILENO)) {
                struct winsize w;