summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-06-01 13:27:03 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-06-01 13:27:03 +0000
commitd0964970a330298cadca3e6ac140382a08481ecf (patch)
treeb2d1222f41e0d7811cef4c92fd60da230a7a737f /examples
parent92a505f0bc95e7aec034166a4cb67669bbef6959 (diff)
downloadmailutils-d0964970a330298cadca3e6ac140382a08481ecf.tar.gz
mailutils-d0964970a330298cadca3e6ac140382a08481ecf.tar.bz2
(main): Bugfix: fields_count had wrong type.
Diffstat (limited to 'examples')
-rw-r--r--examples/mailcap.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/mailcap.c b/examples/mailcap.c
index 8ebd77ba9..81ef71906 100644
--- a/examples/mailcap.c
+++ b/examples/mailcap.c
@@ -54,9 +54,9 @@ main (int argc, char **argv)
mu_mailcap_entries_count (mailcap, &count);
for (i = 1; i <= count; i++)
{
- int j;
+ size_t j;
mu_mailcap_entry_t entry = NULL;
- int fields_count = 0;
+ size_t fields_count = 0;
printf ("entry[%d]\n", i);
@@ -76,8 +76,15 @@ main (int argc, char **argv)
mu_mailcap_entry_fields_count (entry, &fields_count);
for (j = 1; j <= fields_count; j++)
{
- mu_mailcap_entry_get_field (entry, j, buffer,
- sizeof (buffer), NULL);
+ int status = mu_mailcap_entry_get_field (entry, j, buffer,
+ sizeof (buffer), NULL);
+ if (status)
+ {
+ mu_error ("cannot retrieve field %lu: %s",
+ (unsigned long) j,
+ mu_strerror (status));
+ break;
+ }
printf ("\tfields[%d]: %s\n", j, buffer);
}
printf ("\n");

Return to:

Send suggestions and report system problems to the System administrator.