diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-08-10 12:28:36 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-08-10 12:28:36 +0300 |
commit | 6e40542e56205ebcaa607db2092076db8287292a (patch) | |
tree | 97c96bdebd671aaec184ba063c99baac8161b706 | |
parent | 29b6ab7a115af00e066803ab6fac400bccbcad5f (diff) | |
download | mailutils-6e40542e56205ebcaa607db2092076db8287292a.tar.gz mailutils-6e40542e56205ebcaa607db2092076db8287292a.tar.bz2 |
Minor fixes.
* examples/argcv.c (main): Use fgest instead of getline.
* mail/decode.c (mime_descend): Use util_get_hdr_value
which does not cut off the additional arguments after
the ';'.
-rw-r--r-- | examples/argcv.c | 7 | ||||
-rw-r--r-- | mail/decode.c | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/argcv.c b/examples/argcv.c index be37e2bb1..007f62ffa 100644 --- a/examples/argcv.c +++ b/examples/argcv.c @@ -1,5 +1,5 @@ /* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. GNU Mailutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,10 +32,10 @@ main(int argc, char **argv) { char *delim = ""; char *comment = "#"; - char *buf = NULL; + char buf[512]; size_t n = 0; - while (getline (&buf, &n, stdin) > 0) + while (fgets (buf, sizeof buf, stdin)) { int status, c; char **v; @@ -57,6 +57,5 @@ main(int argc, char **argv) } mu_argcv_free (c, v); } - free (buf); exit (0); } diff --git a/mail/decode.c b/mail/decode.c index 1b951fbc2..5de847c63 100644 --- a/mail/decode.c +++ b/mail/decode.c @@ -173,7 +173,9 @@ mime_descend (struct mime_descend_closure *closure, struct mime_descend_closure subclosure; mu_message_get_header (closure->message, &hdr); - util_get_content_type (hdr, &type, NULL); + util_get_hdr_value (hdr, MU_HEADER_CONTENT_TYPE, &type); + if (type == NULL) + type = xstrdup ("text/plain"); get_content_encoding (hdr, &encoding); closure->type = type; |