(mail_from0): Bugfix.
Showing
1 changed file
with
8 additions
and
8 deletions
... | @@ -44,7 +44,7 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) | ... | @@ -44,7 +44,7 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) |
44 | if (address_create (&address, from) == 0) | 44 | if (address_create (&address, from) == 0) |
45 | { | 45 | { |
46 | char name[128]; | 46 | char name[128]; |
47 | size_t len = strlen (from); | 47 | size_t len = strlen (from) + 1; |
48 | *name = '\0'; | 48 | *name = '\0'; |
49 | address_get_personal (address, 1, name, sizeof name, NULL); | 49 | address_get_personal (address, 1, name, sizeof name, NULL); |
50 | if (*name && len) | 50 | if (*name && len) |
... | @@ -53,7 +53,7 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) | ... | @@ -53,7 +53,7 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) |
53 | from[len - 1] = '\0'; | 53 | from[len - 1] = '\0'; |
54 | } | 54 | } |
55 | else | 55 | else |
56 | address_get_email (address, 1, from, strlen (from), NULL); | 56 | address_get_email (address, 1, from, len, NULL); |
57 | address_destroy (&address); | 57 | address_destroy (&address); |
58 | } | 58 | } |
59 | } | 59 | } |
... | @@ -61,17 +61,17 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) | ... | @@ -61,17 +61,17 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) |
61 | 61 | ||
62 | message_get_attribute (msg, &attr); | 62 | message_get_attribute (msg, &attr); |
63 | 63 | ||
64 | if (attribute_is_userflag(attr, MAIL_ATTRIBUTE_MBOXED)) | 64 | if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_MBOXED)) |
65 | cflag = 'M'; | 65 | cflag = 'M'; |
66 | else if (attribute_is_userflag(attr, MAIL_ATTRIBUTE_SAVED)) | 66 | else if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED)) |
67 | cflag = '*'; | 67 | cflag = '*'; |
68 | else if (attribute_is_userflag(attr, MAIL_ATTRIBUTE_TAGGED)) | 68 | else if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_TAGGED)) |
69 | cflag = 'T'; | 69 | cflag = 'T'; |
70 | else if (attribute_is_read (attr)) | 70 | else if (attribute_is_read (attr)) |
71 | cflag = 'R'; | 71 | cflag = 'R'; |
72 | else if (attribute_is_seen (attr)) | 72 | else if (attribute_is_seen (attr)) |
73 | cflag = 'U'; | 73 | cflag = 'U'; |
74 | else if (attribute_is_recent(attr)) | 74 | else if (attribute_is_recent (attr)) |
75 | cflag = 'N'; | 75 | cflag = 'N'; |
76 | else | 76 | else |
77 | cflag = ' '; | 77 | cflag = ' '; |
... | @@ -79,13 +79,13 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) | ... | @@ -79,13 +79,13 @@ mail_from0 (msgset_t *mspec, message_t msg, void *data) |
79 | message_get_envelope (msg, &env); | 79 | message_get_envelope (msg, &env); |
80 | envelope_date (env, date, sizeof (date), NULL); | 80 | envelope_date (env, date, sizeof (date), NULL); |
81 | p = date; | 81 | p = date; |
82 | if (mu_parse_ctime_date_time(&p, &tm, &tz) == 0) | 82 | if (mu_parse_ctime_date_time (&p, &tm, &tz) == 0) |
83 | strftime (date, sizeof(date), "%a %b %e %H:%M", &tm); | 83 | strftime (date, sizeof(date), "%a %b %e %H:%M", &tm); |
84 | 84 | ||
85 | message_size (msg, &m_size); | 85 | message_size (msg, &m_size); |
86 | message_lines (msg, &m_lines); | 86 | message_lines (msg, &m_lines); |
87 | 87 | ||
88 | snprintf (st, sizeof(st), "%3d/%-5d", m_lines, m_size); | 88 | snprintf (st, sizeof (st), "%3d/%-5d", m_lines, m_size); |
89 | 89 | ||
90 | /* The "From" field will take a third of the screen. | 90 | /* The "From" field will take a third of the screen. |
91 | Subject will take the rest. | 91 | Subject will take the rest. | ... | ... |
-
Please register or sign in to post a comment