/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2003 - 2015
* License: GPL
- * Copyright (c) The Exim Maintainers 2016
+ * Copyright (c) The Exim Maintainers 2017
*/
/* Code for setting up a MBOX style spool file inside a /scan/<msgid>
if (!spool_file_wireformat || source_file_override)
j = fread(buffer, 1, sizeof(buffer), data_file);
else /* needs CRLF -> NL */
- if ((s = fgets(buffer, sizeof(buffer), data_file)))
+ if ((s = US fgets(CS buffer, sizeof(buffer), data_file)))
{
uschar * p = s + Ustrlen(s) - 1;
mbox_path = string_sprintf("%s/scan/%s", spool_directory, spooled_message_id);
- tempdir = opendir(CS mbox_path);
- if (!tempdir)
+ if (!(tempdir = opendir(CS mbox_path)))
{
debug_printf("Unable to opendir(%s): %s\n", mbox_path, strerror(errno));
/* Just in case we still can: */
return;
}
/* loop thru dir & delete entries */
- while((entry = readdir(tempdir)) != NULL)
+ while((entry = readdir(tempdir)))
{
uschar *name = US entry->d_name;
int dummy;
file_path = string_sprintf("%s/%s", mbox_path, name);
debug_printf("unspool_mbox(): unlinking '%s'\n", file_path);
- dummy = unlink(CS file_path);
+ dummy = unlink(CS file_path); dummy = dummy; /* compiler quietening */
}
closedir(tempdir);