Commit 6e40542e 6e40542e56205ebcaa607db2092076db8287292a by Sergey Poznyakoff

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 ';'.
1 parent 29b6ab7a
/* 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);
}
......
......@@ -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;
......