diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:25 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:25 +0000 |
commit | b6aae0f38194cd39960a898606ee65d4be93a895 (patch) | |
tree | b73c92aefaf614291a71d05e9d28ca68f4ef021b /networking/netstat.c | |
parent | a41fdf331af344ecd3ec230a072857ea197e1890 (diff) | |
download | busybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.tar.gz busybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.tar.bz2 busybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.zip |
preparatory patch for -Wwrite-strings #2
Diffstat (limited to 'networking/netstat.c')
-rw-r--r-- | networking/netstat.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/networking/netstat.c b/networking/netstat.c index 16ee52d9a..a5631c3c0 100644 --- a/networking/netstat.c +++ b/networking/netstat.c | |||
@@ -68,9 +68,10 @@ typedef enum { | |||
68 | #define SO_WAITDATA (1<<17) /* wait data to read */ | 68 | #define SO_WAITDATA (1<<17) /* wait data to read */ |
69 | #define SO_NOSPACE (1<<18) /* no space to write */ | 69 | #define SO_NOSPACE (1<<18) /* no space to write */ |
70 | 70 | ||
71 | static char *get_sname(int port, const char *proto, int num) | 71 | static const char *get_sname(int port, const char *proto, int num) |
72 | { | 72 | { |
73 | char *str = itoa(ntohs(port)); | 73 | /* hummm, we return static buffer here!! */ |
74 | const char *str = itoa(ntohs(port)); | ||
74 | if (!num) { | 75 | if (!num) { |
75 | struct servent *se = getservbyport(port, proto); | 76 | struct servent *se = getservbyport(port, proto); |
76 | if (se) | 77 | if (se) |
@@ -82,9 +83,9 @@ static char *get_sname(int port, const char *proto, int num) | |||
82 | return str; | 83 | return str; |
83 | } | 84 | } |
84 | 85 | ||
85 | static void snprint_ip_port(char *ip_port, int size, struct sockaddr *addr, int port, char *proto, int numeric) | 86 | static void snprint_ip_port(char *ip_port, int size, struct sockaddr *addr, int port, const char *proto, int numeric) |
86 | { | 87 | { |
87 | char *port_name; | 88 | const char *port_name; |
88 | 89 | ||
89 | #if ENABLE_FEATURE_IPV6 | 90 | #if ENABLE_FEATURE_IPV6 |
90 | if (addr->sa_family == AF_INET6) { | 91 | if (addr->sa_family == AF_INET6) { |
@@ -178,7 +179,8 @@ static void tcp_do_one(int lnr, const char *line) | |||
178 | static void udp_do_one(int lnr, const char *line) | 179 | static void udp_do_one(int lnr, const char *line) |
179 | { | 180 | { |
180 | char local_addr[64], rem_addr[64]; | 181 | char local_addr[64], rem_addr[64]; |
181 | char *state_str, more[512]; | 182 | const char *state_str; |
183 | char more[512]; | ||
182 | int num, local_port, rem_port, d, state, timer_run, uid, timeout; | 184 | int num, local_port, rem_port, d, state, timer_run, uid, timeout; |
183 | #if ENABLE_FEATURE_IPV6 | 185 | #if ENABLE_FEATURE_IPV6 |
184 | struct sockaddr_in6 localaddr, remaddr; | 186 | struct sockaddr_in6 localaddr, remaddr; |
@@ -356,7 +358,7 @@ static void unix_do_one(int nr, const char *line) | |||
356 | { | 358 | { |
357 | static int has = 0; | 359 | static int has = 0; |
358 | char path[PATH_MAX], ss_flags[32]; | 360 | char path[PATH_MAX], ss_flags[32]; |
359 | char *ss_proto, *ss_state, *ss_type; | 361 | const char *ss_proto, *ss_state, *ss_type; |
360 | int num, state, type, inode; | 362 | int num, state, type, inode; |
361 | void *d; | 363 | void *d; |
362 | unsigned long refcnt, proto, unix_flags; | 364 | unsigned long refcnt, proto, unix_flags; |