aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/procmime.c5
-rw-r--r--libsylph/utils.c14
2 files changed, 19 insertions, 0 deletions
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index 98088ad6..81e5829a 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -1119,6 +1119,11 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp,
g_warning(_("procmime_get_text_content(): Code conversion failed.\n"));
fclose(tmpfp);
+ if (fflush(outfp) == EOF) {
+ perror("fflush");
+ fclose(outfp);
+ return NULL;
+ }
rewind(outfp);
return outfp;
diff --git a/libsylph/utils.c b/libsylph/utils.c
index 3cee525e..525c9a1b 100644
--- a/libsylph/utils.c
+++ b/libsylph/utils.c
@@ -2811,6 +2811,10 @@ FILE *canonicalize_file_stream(FILE *src_fp, gint *length)
FILE_OP_ERROR("canonicalize_file_stream", "fgets");
err = TRUE;
}
+ if (fflush(dest_fp) == EOF) {
+ FILE_OP_ERROR("canonicalize_file_stream", "fflush");
+ err = TRUE;
+ }
if (err) {
fclose(dest_fp);
@@ -2967,6 +2971,11 @@ FILE *get_outgoing_rfc2822_file(FILE *fp)
goto file_error;
}
+ if (fflush(outfp) == EOF) {
+ FILE_OP_ERROR("get_outgoing_rfc2822_file", "fflush");
+ goto file_error;
+ }
+
rewind(outfp);
return outfp;
@@ -3234,6 +3243,11 @@ FILE *str_open_as_stream(const gchar *str)
fclose(fp);
return NULL;
}
+ if (fflush(fp) == EOF) {
+ FILE_OP_ERROR("str_open_as_stream", "fflush");
+ fclose(fp);
+ return NULL;
+ }
rewind(fp);
return fp;