aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-02-03 03:31:13 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-02-03 03:31:13 +0000
commit4c978631096a97e1cd68dfe40a1583de537112c4 (patch)
tree72450c173aeeb2b13c0965635f1867f76738f42d
parente968fcd562da08591b0f7990b839174ad93fc7b4 (diff)
downloadbusybox-w32-4c978631096a97e1cd68dfe40a1583de537112c4.tar.gz
busybox-w32-4c978631096a97e1cd68dfe40a1583de537112c4.tar.bz2
busybox-w32-4c978631096a97e1cd68dfe40a1583de537112c4.zip
assorted fixes for bugs found with randomconfig
-rw-r--r--findutils/find.c5
-rw-r--r--init/init.c2
-rw-r--r--networking/ether-wake.c3
-rw-r--r--networking/ping.c2
-rw-r--r--shell/hush.c8
5 files changed, 12 insertions, 8 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 2decb3608..d71af9ca9 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -316,12 +316,15 @@ static int find_type(const char *type)
316} 316}
317#endif 317#endif
318 318
319#if ENABLE_FEATURE_FIND_PERM || ENABLE_FEATURE_FIND_MTIME \
320 || ENABLE_FEATURE_FIND_MMIN
319static const char* plus_minus_num(const char* str) 321static const char* plus_minus_num(const char* str)
320{ 322{
321 if (*str == '-' || *str == '+') 323 if (*str == '-' || *str == '+')
322 str++; 324 str++;
323 return str; 325 return str;
324} 326}
327#endif
325 328
326static action*** parse_params(char **argv) 329static action*** parse_params(char **argv)
327{ 330{
@@ -486,7 +489,7 @@ static action*** parse_params(char **argv)
486 ap->subst_count[i] = count_subst(ap->exec_argv[i]); 489 ap->subst_count[i] = count_subst(ap->exec_argv[i]);
487 } 490 }
488#endif 491#endif
489#ifdef ENABLE_FEATURE_FIND_USER 492#if ENABLE_FEATURE_FIND_USER
490 else if (strcmp(arg, "-user") == 0) { 493 else if (strcmp(arg, "-user") == 0) {
491 action_user *ap; 494 action_user *ap;
492 if (!*++argv) 495 if (!*++argv)
diff --git a/init/init.c b/init/init.c
index b652bc1f4..dc8752447 100644
--- a/init/init.c
+++ b/init/init.c
@@ -122,7 +122,7 @@ static struct init_action *init_action_list = NULL;
122static char console[CONSOLE_BUFF_SIZE] = CONSOLE_DEV; 122static char console[CONSOLE_BUFF_SIZE] = CONSOLE_DEV;
123 123
124#if !ENABLE_SYSLOGD 124#if !ENABLE_SYSLOGD
125static char *log_console = VC_5; 125static const char *log_console = VC_5;
126#endif 126#endif
127#if !ENABLE_DEBUG_INIT 127#if !ENABLE_DEBUG_INIT
128static sig_atomic_t got_cont = 0; 128static sig_atomic_t got_cont = 0;
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index 7e3ef4948..f923149b9 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -107,7 +107,8 @@ static inline int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd);
107 107
108int ether_wake_main(int argc, char *argv[]) 108int ether_wake_main(int argc, char *argv[])
109{ 109{
110 char *ifname = "eth0", *pass = NULL; 110 const char *ifname = "eth0";
111 char *pass = NULL;
111 unsigned long flags; 112 unsigned long flags;
112 unsigned char wol_passwd[6]; 113 unsigned char wol_passwd[6];
113 int wol_passwd_sz = 0; 114 int wol_passwd_sz = 0;
diff --git a/networking/ping.c b/networking/ping.c
index 53aabb6d7..ba4f585db 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -190,7 +190,7 @@ int ping_main(int argc, char **argv)
190 len_and_sockaddr *lsa; 190 len_and_sockaddr *lsa;
191#if ENABLE_PING6 191#if ENABLE_PING6
192 sa_family_t af = AF_UNSPEC; 192 sa_family_t af = AF_UNSPEC;
193 while (++argv[0][0]) == '-') { 193 while (++argv[0][0] == '-') {
194 if (argv[0][1] == '4') { 194 if (argv[0][1] == '4') {
195 af = AF_INET; 195 af = AF_INET;
196 continue; 196 continue;
diff --git a/shell/hush.c b/shell/hush.c
index 7bc3b9a1e..c3640ed3a 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2795,8 +2795,8 @@ int hush_main(int argc, char **argv)
2795 } 2795 }
2796 2796
2797 debug_printf("\nrunning script '%s'\n", argv[optind]); 2797 debug_printf("\nrunning script '%s'\n", argv[optind]);
2798 global_argv = argv+optind; 2798 global_argv = argv + optind;
2799 global_argc = argc-optind; 2799 global_argc = argc - optind;
2800 input = xfopen(argv[optind], "r"); 2800 input = xfopen(argv[optind], "r");
2801 opt = parse_file_outer(input); 2801 opt = parse_file_outer(input);
2802 2802
@@ -2809,8 +2809,8 @@ int hush_main(int argc, char **argv)
2809 for (cur = top_vars; cur; cur = tmp) { 2809 for (cur = top_vars; cur; cur = tmp) {
2810 tmp = cur->next; 2810 tmp = cur->next;
2811 if (!cur->flg_read_only) { 2811 if (!cur->flg_read_only) {
2812 free(cur->name); 2812 free((char*)cur->name);
2813 free(cur->value); 2813 free((char*)cur->value);
2814 free(cur); 2814 free(cur);
2815 } 2815 }
2816 } 2816 }