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 ';'.
Showing
2 changed files
with
6 additions
and
5 deletions
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 2005, 2007 Free Software Foundation, Inc. | 2 | Copyright (C) 2005, 2007, 2009 Free Software Foundation, Inc. |
3 | 3 | ||
4 | GNU Mailutils is free software; you can redistribute it and/or modify | 4 | GNU Mailutils is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
... | @@ -32,10 +32,10 @@ main(int argc, char **argv) | ... | @@ -32,10 +32,10 @@ main(int argc, char **argv) |
32 | { | 32 | { |
33 | char *delim = ""; | 33 | char *delim = ""; |
34 | char *comment = "#"; | 34 | char *comment = "#"; |
35 | char *buf = NULL; | 35 | char buf[512]; |
36 | size_t n = 0; | 36 | size_t n = 0; |
37 | 37 | ||
38 | while (getline (&buf, &n, stdin) > 0) | 38 | while (fgets (buf, sizeof buf, stdin)) |
39 | { | 39 | { |
40 | int status, c; | 40 | int status, c; |
41 | char **v; | 41 | char **v; |
... | @@ -57,6 +57,5 @@ main(int argc, char **argv) | ... | @@ -57,6 +57,5 @@ main(int argc, char **argv) |
57 | } | 57 | } |
58 | mu_argcv_free (c, v); | 58 | mu_argcv_free (c, v); |
59 | } | 59 | } |
60 | free (buf); | ||
61 | exit (0); | 60 | exit (0); |
62 | } | 61 | } | ... | ... |
... | @@ -173,7 +173,9 @@ mime_descend (struct mime_descend_closure *closure, | ... | @@ -173,7 +173,9 @@ mime_descend (struct mime_descend_closure *closure, |
173 | struct mime_descend_closure subclosure; | 173 | struct mime_descend_closure subclosure; |
174 | 174 | ||
175 | mu_message_get_header (closure->message, &hdr); | 175 | mu_message_get_header (closure->message, &hdr); |
176 | util_get_content_type (hdr, &type, NULL); | 176 | util_get_hdr_value (hdr, MU_HEADER_CONTENT_TYPE, &type); |
177 | if (type == NULL) | ||
178 | type = xstrdup ("text/plain"); | ||
177 | get_content_encoding (hdr, &encoding); | 179 | get_content_encoding (hdr, &encoding); |
178 | 180 | ||
179 | closure->type = type; | 181 | closure->type = type; | ... | ... |
-
Please register or sign in to post a comment