diff -u -p -Nr --exclude CVS mailutils-20020409.orig/mailbox/header.c mailutils-20020409/mailbox/header.c
--- mailutils-20020409.orig/mailbox/header.c	2001-12-16 16:59:14.000000000 +0100
+++ mailutils-20020409/mailbox/header.c	2005-05-26 20:09:26.000000000 +0200
@@ -621,7 +621,7 @@ header_get_field_name (header_t header, 
     {
       /* save one for the null */
       --buflen;
-      len = (len > buflen) ? len : len;
+      len = (len > buflen) ? buflen : len;
       memcpy (buf, header->hdr[num].fn, len);
       buf[len] = '\0';
     }
