summaryrefslogtreecommitdiff
path: root/pith/mailview.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2018-05-13 01:38:56 -0600
committerEduardo Chappa <chappa@washington.edu>2018-05-13 01:38:56 -0600
commitaac7b10863bcfabe936feb5151e7e11123e13306 (patch)
tree8033a31daed6c94fcbdd41eef1682ba0539cfabd /pith/mailview.c
parent400647dcc1b040f82d22d539fc013f5e23132049 (diff)
downloadalpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'pith/mailview.c')
-rw-r--r--pith/mailview.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/pith/mailview.c b/pith/mailview.c
index 3fe1dd81..39fcfff6 100644
--- a/pith/mailview.c
+++ b/pith/mailview.c
@@ -156,7 +156,7 @@ format_message(long int msgno, ENVELOPE *env, struct mail_bodystruct *body,
{
char *decode_err = NULL;
HEADER_S h;
- int width;
+ int width, rv;
clear_cur_embedded_color();
@@ -201,9 +201,14 @@ format_message(long int msgno, ENVELOPE *env, struct mail_bodystruct *body,
}
/* write delimiter and body */
- if(gf_puts(NEWLINE, pc)
- && (decode_err = format_body(msgno, body, handlesp, &h, flgs, width, pc)) == NULL)
- return(1);
+ if(gf_puts(NEWLINE, pc)){
+ if((decode_err = format_body(msgno, body, handlesp, &h, flgs, width, pc)) == NULL)
+ rv = 1;
+ else
+ rv = 0;
+ }
+ clear_cur_embedded_color();
+ return(rv);
write_error:
@@ -211,7 +216,7 @@ format_message(long int msgno, ENVELOPE *env, struct mail_bodystruct *body,
if(!(flgs & FM_DISPLAY))
q_status_message1(SM_ORDER, 3, 4, _("Error writing message: %s"),
decode_err ? decode_err : error_description(errno));
-
+ clear_cur_embedded_color();
return(0);
}
@@ -521,6 +526,7 @@ format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int w
gf_puts(NEWLINE, pc);
continue;
}
+ caltext[callen] = '\0';
break;
case ENCQUOTEDPRINTABLE:
@@ -530,6 +536,7 @@ format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int w
gf_puts(NEWLINE, pc);
continue;
}
+ caltext[callen] = '\0';
break;
default: caltext = cpystr(rawtext);