diff options
author | Glenn L McGrath | 2004-09-14 17:24:59 +0000 |
---|---|---|
committer | Glenn L McGrath | 2004-09-14 17:24:59 +0000 |
commit | d4004ee6a933eaf3d3843624d8c63e922db8d7dd (patch) | |
tree | cef7a75838b66f62fb18c2b0f2479d29ce0422ba /networking | |
parent | ab1955c2367d18e25fde1791a2660ae69976c623 (diff) | |
download | busybox-d4004ee6a933eaf3d3843624d8c63e922db8d7dd.zip busybox-d4004ee6a933eaf3d3843624d8c63e922db8d7dd.tar.gz |
Patch from Felipe Kellermann, remove some unnecessary dups, i declared a few extra const's also.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/ifupdown.c | 6 | ||||
-rw-r--r-- | networking/telnet.c | 4 | ||||
-rw-r--r-- | networking/telnetd.c | 11 | ||||
-rw-r--r-- | networking/tftp.c | 8 |
4 files changed, 14 insertions, 15 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index b2ce2a0..1842be5 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -699,7 +699,7 @@ static const llist_t *find_list_string(const llist_t *list, const char *string) return(NULL); } -static struct interfaces_file_t *read_interfaces(char *filename) +static struct interfaces_file_t *read_interfaces(const char *filename) { #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING struct mapping_defn_t *currmap = NULL; @@ -1192,7 +1192,7 @@ extern int ifupdown_main(int argc, char **argv) FILE *state_fp = NULL; llist_t *state_list = NULL; llist_t *target_list = NULL; - char *interfaces = "/etc/network/interfaces"; + const char *interfaces = "/etc/network/interfaces"; const char *statefile = "/var/run/ifstate"; #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING @@ -1219,7 +1219,7 @@ extern int ifupdown_main(int argc, char **argv) { switch (i) { case 'i': /* interfaces */ - interfaces = bb_xstrdup(optarg); + interfaces = optarg; break; case 'v': /* verbose */ verbose = 1; diff --git a/networking/telnet.c b/networking/telnet.c index 6c5f3d1..6ad7712 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -132,7 +132,7 @@ static char *ttype; #endif #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN -static char *autologin; +static const char *autologin; #endif #ifdef CONFIG_FEATURE_AUTOWIDTH @@ -663,7 +663,7 @@ extern int telnet_main(int argc, char** argv) while ((opt = getopt(argc, argv, "al:")) != EOF) { switch (opt) { case 'l': - autologin = bb_xstrdup(optarg); + autologin = optarg; break; case 'a': autologin = getenv("USER"); diff --git a/networking/telnetd.c b/networking/telnetd.c index 724c7cf..491c66f 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -1,4 +1,4 @@ -/* $Id: telnetd.c,v 1.12 2004/06/22 10:07:17 andersen Exp $ +/* $Id: telnetd.c,v 1.13 2004/09/14 17:24:58 bug1 Exp $ * * Simple telnet server * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) @@ -49,11 +49,10 @@ #define BUFSIZE 4000 -static const char *loginpath #ifdef CONFIG_LOGIN - = "/bin/login"; +static const char *loginpath = "/bin/login"; #else -; +static const char *loginpath; #endif static const char *issuefile = "/etc/issue.net"; @@ -401,10 +400,10 @@ telnetd_main(int argc, char **argv) if (c == EOF) break; switch (c) { case 'f': - issuefile = strdup (optarg); + issuefile = optarg; break; case 'l': - loginpath = strdup (optarg); + loginpath = optarg; break; #ifndef CONFIG_FEATURE_TELNETD_INETD case 'p': diff --git a/networking/tftp.c b/networking/tftp.c index 02ddb4d..3c94731 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -485,8 +485,8 @@ static inline int tftp(const int cmd, const struct hostent *host, int tftp_main(int argc, char **argv) { struct hostent *host = NULL; - char *localfile = NULL; - char *remotefile = NULL; + const char *localfile = NULL; + const char *remotefile = NULL; int port; int cmd = 0; int fd = -1; @@ -538,10 +538,10 @@ int tftp_main(int argc, char **argv) break; #endif case 'l': - localfile = bb_xstrdup(optarg); + localfile = optarg; break; case 'r': - remotefile = bb_xstrdup(optarg); + remotefile = optarg; break; } } |