/* returns a pointer to the FILE, and puts the size in bytes into mbox_file_size
* normally, source_file_override is NULL */
-FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
+FILE *
+spool_mbox(unsigned long *mbox_file_size, const uschar *source_file_override)
+{
uschar message_subdir[2];
uschar buffer[16384];
uschar *temp_string;
};
/* End headers */
- (void)fwrite("\n", 1, 1, mbox_file);
+ if (fwrite("\n", 1, 1, mbox_file) != 1) {
+ log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
+ message headers to %s", mbox_path);
+ goto OUT;
+ }
/* copy body file */
if (source_file_override == NULL) {