X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f3ebb786e451da973560f1c9d8cdb151d25108b5..54a2a2a9983913a91ccef3aac107a159434a4714:/src/src/transports/tf_maildir.c diff --git a/src/src/transports/tf_maildir.c b/src/src/transports/tf_maildir.c index 611895e06..bcd091b75 100644 --- a/src/src/transports/tf_maildir.c +++ b/src/src/transports/tf_maildir.c @@ -147,10 +147,8 @@ if (maildirfolder_create_regex != NULL) DEBUG(D_transport) debug_printf("checking for maildirfolder requirement\n"); - regex = pcre_compile(CS maildirfolder_create_regex, PCRE_COPT, - (const char **)&error, &offset, NULL); - - if (regex == NULL) + if (!(regex = pcre_compile(CS maildirfolder_create_regex, PCRE_COPT, + CCSS &error, &offset, NULL))) { addr->message = string_sprintf("appendfile: regular expression " "error: %s at offset %d while compiling %s", error, offset, @@ -255,15 +253,14 @@ maildir_compute_size(uschar *path, int *filecount, time_t *latest, { DIR *dir; off_t sum = 0; -struct dirent *ent; -struct stat statbuf; -if (!(dir = opendir(CS path))) +if (!(dir = exim_opendir(path))) return 0; -while ((ent = readdir(dir))) +for (struct dirent *ent; ent = readdir(dir); ) { uschar * s, * name = US ent->d_name; + struct stat statbuf; if (Ustrcmp(name, ".") == 0 || Ustrcmp(name, "..") == 0) continue;