diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:58 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:58 +0000 |
commit | ab2aea44479fd6f519bccd651a37f30e792b7593 (patch) | |
tree | 443636e12ffb52db95168013bbda80f78ed49fe6 /networking/libiproute | |
parent | 06c0a71d2315756db874e98bc4f760ca3283b6a6 (diff) | |
download | busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.tar.gz busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.tar.bz2 busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.zip |
preparatory patch for -Wwrite-strings #4
Diffstat (limited to 'networking/libiproute')
-rw-r--r-- | networking/libiproute/iptunnel.c | 6 | ||||
-rw-r--r-- | networking/libiproute/rt_names.c | 11 | ||||
-rw-r--r-- | networking/libiproute/utils.c | 20 | ||||
-rw-r--r-- | networking/libiproute/utils.h | 6 |
4 files changed, 20 insertions, 23 deletions
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index a67803ff4..e2e75fce0 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -85,7 +85,7 @@ static char *do_ioctl_get_ifname(int idx) | |||
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p) | 88 | static int do_get_ioctl(const char *basedev, struct ip_tunnel_parm *p) |
89 | { | 89 | { |
90 | struct ifreq ifr; | 90 | struct ifreq ifr; |
91 | int fd; | 91 | int fd; |
@@ -102,7 +102,7 @@ static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p) | |||
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p) | 105 | static int do_add_ioctl(int cmd, const char *basedev, struct ip_tunnel_parm *p) |
106 | { | 106 | { |
107 | struct ifreq ifr; | 107 | struct ifreq ifr; |
108 | int fd; | 108 | int fd; |
@@ -123,7 +123,7 @@ static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p) | |||
123 | return err; | 123 | return err; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int do_del_ioctl(char *basedev, struct ip_tunnel_parm *p) | 126 | static int do_del_ioctl(const char *basedev, struct ip_tunnel_parm *p) |
127 | { | 127 | { |
128 | struct ifreq ifr; | 128 | struct ifreq ifr; |
129 | int fd; | 129 | int fd; |
diff --git a/networking/libiproute/rt_names.c b/networking/libiproute/rt_names.c index 686326ff9..797c83b4e 100644 --- a/networking/libiproute/rt_names.c +++ b/networking/libiproute/rt_names.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include "libbb.h" | 13 | #include "libbb.h" |
14 | #include "rt_names.h" | 14 | #include "rt_names.h" |
15 | 15 | ||
16 | static void rtnl_tab_initialize(char *file, const char **tab, int size) | 16 | static void rtnl_tab_initialize(const char *file, const char **tab, int size) |
17 | { | 17 | { |
18 | char buf[512]; | 18 | char buf[512]; |
19 | FILE *fp; | 19 | FILE *fp; |
@@ -30,10 +30,11 @@ static void rtnl_tab_initialize(char *file, const char **tab, int size) | |||
30 | p++; | 30 | p++; |
31 | if (*p == '#' || *p == '\n' || *p == 0) | 31 | if (*p == '#' || *p == '\n' || *p == 0) |
32 | continue; | 32 | continue; |
33 | if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 && | 33 | if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 |
34 | sscanf(p, "0x%x %s #", &id, namebuf) != 2 && | 34 | && sscanf(p, "0x%x %s #", &id, namebuf) != 2 |
35 | sscanf(p, "%d %s\n", &id, namebuf) != 2 && | 35 | && sscanf(p, "%d %s\n", &id, namebuf) != 2 |
36 | sscanf(p, "%d %s #", &id, namebuf) != 2) { | 36 | && sscanf(p, "%d %s #", &id, namebuf) != 2 |
37 | ) { | ||
37 | bb_error_msg("database %s is corrupted at %s", | 38 | bb_error_msg("database %s is corrupted at %s", |
38 | file, p); | 39 | file, p); |
39 | return; | 40 | return; |
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index 5e06656f6..591c8933a 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c | |||
@@ -178,7 +178,7 @@ int get_prefix_1(inet_prefix * dst, char *arg, int family) | |||
178 | 178 | ||
179 | slash = strchr(arg, '/'); | 179 | slash = strchr(arg, '/'); |
180 | if (slash) | 180 | if (slash) |
181 | *slash = 0; | 181 | *slash = '\0'; |
182 | err = get_addr_1(dst, arg, family); | 182 | err = get_addr_1(dst, arg, family); |
183 | if (err == 0) { | 183 | if (err == 0) { |
184 | switch (dst->family) { | 184 | switch (dst->family) { |
@@ -237,26 +237,22 @@ uint32_t get_addr32(char *name) | |||
237 | 237 | ||
238 | void incomplete_command(void) | 238 | void incomplete_command(void) |
239 | { | 239 | { |
240 | bb_error_msg("command line is not complete, try option \"help\""); | 240 | bb_error_msg_and_die("command line is not complete, try option \"help\""); |
241 | exit(-1); | ||
242 | } | 241 | } |
243 | 242 | ||
244 | void invarg(const char * const arg, const char * const opt) | 243 | void invarg(const char *arg, const char *opt) |
245 | { | 244 | { |
246 | bb_error_msg(bb_msg_invalid_arg, arg, opt); | 245 | bb_error_msg_and_die(bb_msg_invalid_arg, arg, opt); |
247 | exit(-1); | ||
248 | } | 246 | } |
249 | 247 | ||
250 | void duparg(char *key, char *arg) | 248 | void duparg(const char *key, const char *arg) |
251 | { | 249 | { |
252 | bb_error_msg("duplicate \"%s\": \"%s\" is the second value", key, arg); | 250 | bb_error_msg_and_die("duplicate \"%s\": \"%s\" is the second value", key, arg); |
253 | exit(-1); | ||
254 | } | 251 | } |
255 | 252 | ||
256 | void duparg2(char *key, char *arg) | 253 | void duparg2(const char *key, const char *arg) |
257 | { | 254 | { |
258 | bb_error_msg("either \"%s\" is duplicate, or \"%s\" is garbage", key, arg); | 255 | bb_error_msg_and_die("either \"%s\" is duplicate, or \"%s\" is garbage", key, arg); |
259 | exit(-1); | ||
260 | } | 256 | } |
261 | 257 | ||
262 | int matches(const char *cmd, const char *pattern) | 258 | int matches(const char *cmd, const char *pattern) |
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index 5af8ba744..ebf2af194 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h | |||
@@ -75,9 +75,9 @@ extern int get_s8(int8_t *val, char *arg, int base); | |||
75 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); | 75 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); |
76 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); | 76 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); |
77 | 77 | ||
78 | void invarg(const char * const, const char * const) ATTRIBUTE_NORETURN; | 78 | void invarg(const char *, const char *) ATTRIBUTE_NORETURN; |
79 | void duparg(char *, char *) ATTRIBUTE_NORETURN; | 79 | void duparg(const char *, const char *) ATTRIBUTE_NORETURN; |
80 | void duparg2(char *, char *) ATTRIBUTE_NORETURN; | 80 | void duparg2(const char *, const char *) ATTRIBUTE_NORETURN; |
81 | int matches(const char *arg, const char *pattern); | 81 | int matches(const char *arg, const char *pattern); |
82 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); | 82 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); |
83 | 83 | ||