diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-10 20:46:39 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-10 20:46:39 +0000 |
commit | 8d07560eef94262d0e156e48ea8ecf17db20e794 (patch) | |
tree | 389ac3098c7e570d987bc2aa695ded0d7bccf1f1 /networking | |
parent | 63e49fa56f31aca5b62d9382e9c621307232b241 (diff) | |
download | busybox-w32-8d07560eef94262d0e156e48ea8ecf17db20e794.tar.gz busybox-w32-8d07560eef94262d0e156e48ea8ecf17db20e794.tar.bz2 busybox-w32-8d07560eef94262d0e156e48ea8ecf17db20e794.zip |
sendmail: work around (bogus) gcc warning
Diffstat (limited to 'networking')
-rw-r--r-- | networking/sendmail.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/networking/sendmail.c b/networking/sendmail.c index e6af3d40a..c605d7c1b 100644 --- a/networking/sendmail.c +++ b/networking/sendmail.c | |||
@@ -255,7 +255,8 @@ static void pop3_message(const char *filename) | |||
255 | } | 255 | } |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | static char *parse_url(char *url, char **user, char **pass) | 258 | // NB: parse_url can modify url[] (despite const), but only if '@' is there |
259 | static const char *parse_url(const char *url, const char **user, const char **pass) | ||
259 | { | 260 | { |
260 | // parse [user[:pass]@]host | 261 | // parse [user[:pass]@]host |
261 | // return host | 262 | // return host |
@@ -284,8 +285,8 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv) | |||
284 | { | 285 | { |
285 | llist_t *opt_attachments = NULL; | 286 | llist_t *opt_attachments = NULL; |
286 | char *opt_from; | 287 | char *opt_from; |
287 | char *opt_user; | 288 | const char *opt_user; |
288 | char *opt_pass; | 289 | const char *opt_pass; |
289 | enum { | 290 | enum { |
290 | OPT_w = 1 << 0, // network timeout | 291 | OPT_w = 1 << 0, // network timeout |
291 | OPT_H = 1 << 1, // [user:password@]server[:port] | 292 | OPT_H = 1 << 1, // [user:password@]server[:port] |
@@ -344,7 +345,7 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv) | |||
344 | // fetch username and password, if any | 345 | // fetch username and password, if any |
345 | // NB: parse_url modifies opt_connect[] ONLY if '@' is there. | 346 | // NB: parse_url modifies opt_connect[] ONLY if '@' is there. |
346 | // Thus "127.0.0.1" won't be modified, an is ok that it is RO. | 347 | // Thus "127.0.0.1" won't be modified, an is ok that it is RO. |
347 | opt_connect = parse_url((char*)opt_connect, &opt_user, &opt_pass); | 348 | opt_connect = parse_url(opt_connect, &opt_user, &opt_pass); |
348 | // bb_error_msg("H[%s] U[%s] P[%s]", opt_connect, opt_user, opt_pass); | 349 | // bb_error_msg("H[%s] U[%s] P[%s]", opt_connect, opt_user, opt_pass); |
349 | 350 | ||
350 | // username must be defined! | 351 | // username must be defined! |
@@ -405,7 +406,7 @@ int sendgetmail_main(int argc UNUSED_PARAM, char **argv) | |||
405 | // set sender | 406 | // set sender |
406 | // NOTE: if password has not been specified | 407 | // NOTE: if password has not been specified |
407 | // then no authentication is possible | 408 | // then no authentication is possible |
408 | code = (opt_pass) ? -1 : 250; | 409 | code = (opt_pass ? -1 : 250); |
409 | // first try softly without authentication | 410 | // first try softly without authentication |
410 | while (250 != smtp_checkp("MAIL FROM:<%s>", opt_from, code)) { | 411 | while (250 != smtp_checkp("MAIL FROM:<%s>", opt_from, code)) { |
411 | // MAIL FROM failed -> authentication needed | 412 | // MAIL FROM failed -> authentication needed |