text.firstPos = 0;
text.format = FMT8BIT;
- dir = (XawTextScanDirection)(int) ((caddr_t)XawToggleGetCurrent(search->left_toggle) -
+ dir = (XawTextScanDirection) ((long)XawToggleGetCurrent(search->left_toggle) -
R_OFFSET);
pos = XawTextSearch( tw, dir, &text);
msglogAction(Widget w, XtPointer client_data, XtPointer call_data)
{
int i;
-Widget text = text_create((uschar *)client_data, text_depth);
-uschar * fname;
-FILE *f = NULL;
+Widget text = text_create(US client_data, text_depth);
+uschar * fname = NULL;
+FILE * f = NULL;
w = w; /* Keep picky compilers happy */
call_data = call_data;
/* End up with the split version, so message looks right when non-exist */
-for (i = 0; i < (spool_is_split? 2:1); i++)
+for (i = 0; i < (spool_is_split ? 2:1); i++)
{
- message_subdir[0] = i != 0 ? ((uschar *)client_data)[5] : 0;
+ message_subdir[0] = i != 0 ? (US client_data)[5] : 0;
fname = spool_fname(US"msglog", message_subdir, US client_data, US"");
if ((f = fopen(CS fname, "r")))
break;
}
-if (f == NULL)
+if (!f)
text_showf(text, "%s: %s\n", fname, strerror(errno));
else
{
passed back via the value pointer without the compiler doing an
unwanted cast. */
-static void stripchartAction(Widget w, XtPointer client_data, XtPointer value)
+static void
+stripchartAction(Widget w, XtPointer client_data, XtPointer value)
{
-double *ptr = (double *)value;
+double * ptr = (double *)value;
static int thresholds[] =
{10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 0};
-int num = (int)client_data;
+int num = (long)client_data;
int oldmax = 0;
int newmax = 0;
int newvalue = 0;
initially set to 1 second so that it gives an immediate display of the queue.
The first time its callback function is obeyed, the update time gets reset. */
-void create_stripchart(Widget parent, uschar *title)
+void
+create_stripchart(Widget parent, uschar *title)
{
Widget chart;
XtNfromVert, label);
XtAddCallback(chart, "getValue", stripchartAction,
- (XtPointer)stripchart_count);
+ (XtPointer)(long)stripchart_count);
stripchart_last_total[stripchart_count] = 0;
stripchart_max[stripchart_count] = 10;
if (queue_pid_slots)
{
- int max = atoi(expand_string(queue_run_max));
+ int max = atoi(CS expand_string(queue_run_max));
for (i = 0; i < max; i++)
if (queue_pid_slots[i] == pid)
{
int listen_socket_count = 0;
ip_address_item *addresses = NULL;
time_t last_connection_time = (time_t)0;
-int local_queue_run_max = atoi(expand_string(queue_run_max));
+int local_queue_run_max = atoi(CS expand_string(queue_run_max));
/* If any debugging options are set, turn on the D_pid bit so that all
debugging lines get the pid added. */
else
{
uschar *envtz = US getenv("TZ");
- if (envtz ? !timezone_string || Ustrcmp(timezone_string, envtz) != 0 : timezone_string)
+ if (envtz
+ ? !timezone_string || Ustrcmp(timezone_string, envtz) != 0
+ : timezone_string != NULL
+ )
{
uschar **p = USS environ;
uschar **new;
if (record == NULL) printf("not found\n"); else
{
time_t tt;
- int length = 0; /* Stops compiler warning */
+ /*int length = 0; Stops compiler warning */
switch(dbdata_type)
{
case type_retry:
retry = (dbdata_retry *)record;
- length = sizeof(dbdata_retry) + Ustrlen(retry->text);
+ /* length = sizeof(dbdata_retry) + Ustrlen(retry->text); */
switch(fieldno)
{
case type_callout:
callout = (dbdata_callout_cache *)record;
- length = sizeof(dbdata_callout_cache);
+ /* length = sizeof(dbdata_callout_cache); */
switch(fieldno)
{
case 0:
const uschar * s = sub;
uschar c;
- for (s = sub; c = *s; s++)
+ for (s = sub; (c = *s); s++)
yield = c < 127 && c != '\\'
? string_catn(yield, &size, &ptr, s, 1)
: string_catn(yield, &size, &ptr, string_sprintf("\\%03o", c), 4);
string_item *aa;
uschar *saveptr = ptr;
ptr = nextword(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
if (Ustrcmp(buffer, "alias") != 0)
{
ptr = saveptr;
break;
}
ptr = nextitem(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
aa = store_get(sizeof(string_item));
aa->text = string_copy(buffer);
aa->next = c->left.a;
else if (Ustrcmp(buffer, "foranyaddress") == 0)
{
ptr = nextitem(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
if (*ptr != '(')
{
*error_pointer = string_sprintf("\"(\" expected after \"foranyaddress\" "
c->left.u = string_copy(buffer);
ptr = read_condition(nextsigchar(ptr+1, TRUE), &(c->right.c), FALSE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
if (*ptr != ')')
{
*error_pointer = string_sprintf("expected \")\" in line %d of "
"filter file", line_number);
break;
}
- if (!testfor)
- {
- c->testfor = !c->testfor;
- testfor = TRUE;
- }
ptr = nextsigchar(ptr+1, TRUE);
}
c->left.u = string_copy(buffer);
ptr = nextword(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
/* Handle "does|is [not]", preserving the pointer after "is" in
case it isn't that, but the form "is <string>". */
if (buffer[0] == 'I') { c->type = cond_IS; isptr = ptr; }
ptr = nextword(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
if (strcmpic(buffer, US"not") == 0)
{
c->testfor = !c->testfor;
- if (isptr != NULL) isptr = ptr;
+ if (isptr) isptr = ptr;
ptr = nextword(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
}
}
if (i >= cond_word_count)
{
- if (isptr != NULL)
- {
- ptr = isptr;
- }
- else
+ if (!isptr)
{
*error_pointer = string_sprintf("unrecognized condition word \"%s\" "
"near line %d of filter file", buffer, line_number);
break;
}
+ ptr = isptr;
}
/* Get the RH argument. */
ptr = nextitem(ptr, buffer, sizeof(buffer), TRUE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
c->right.u = string_copy(buffer);
}
}
{
uschar *saveptr = ptr;
ptr = nextword(ptr, buffer, sizeof(buffer), FALSE);
- if (*error_pointer != NULL) break;
+ if (*error_pointer) break;
/* "Then" terminates a toplevel condition; otherwise a closing bracket
has been omitted. Put a string terminator at the start of "then" so
if (Ustrcmp(buffer, "then") == 0)
{
if (toplevel) *saveptr = 0;
- else *error_pointer = string_sprintf("missing \")\" at end of "
+ else *error_pointer = string_sprintf("missing \")\" at end of "
"condition near line %d of filter file", line_number);
break;
}
condition_block *orc = store_get(sizeof(condition_block));
condition_block *or_parent = NULL;
- if (current_parent != NULL)
+ if (current_parent)
{
- while (current_parent->parent != NULL &&
+ while (current_parent->parent &&
current_parent->parent->type == cond_and)
current_parent = current_parent->parent;
/* If the parent has a parent, it must be an "or" parent. */
- if (current_parent->parent != NULL)
+ if (current_parent->parent)
or_parent = current_parent->parent;
}
orc->parent = or_parent;
- if (or_parent == NULL) *cond = orc; else
- or_parent->right.c = orc;
+ if (!or_parent) *cond = orc;
+ else or_parent->right.c = orc;
orc->type = cond_or;
orc->testfor = TRUE;
orc->left.c = (current_parent == NULL)? c : current_parent;
with a flag that fails symlinks. */
{
- int fd = open(directory, O_RDONLY);
+ int fd = open(CS directory, O_RDONLY);
if (fd < 0)
{
*error = string_sprintf("failed to open directory %s", directory);
temp = *p;
*p = '\0';
- fd2 = openat(fd, q, O_RDONLY|O_NOFOLLOW);
+ fd2 = openat(fd, CS q, O_RDONLY|O_NOFOLLOW);
close(fd);
*p = temp;
if (fd2 < 0)
/*XXX walk the list of headers in same order as received. */
for (hdrs = ctx->headers; hdrs; hdrs = hdrs->next)
if ( hdrs->tag == 0
- && strncasecmp(hdrs->value, CS p, Ustrlen(p)) == 0
+ && strncasecmp(CCS hdrs->value, CCS p, Ustrlen(p)) == 0
&& (hdrs->value)[Ustrlen(p)] == ':'
)
{
/* Routines with knowlege of spool layout */
+#ifndef COMPILE_UTILITY
static void
spool_pname_buf(uschar * buf, int len)
{
return string_sprintf("%s/%s/%s/%s",
spool_directory, queue_name, purpose, subdir);
}
+#endif
uschar *
spool_sname(const uschar * purpose, uschar * subdir)
due to conflicts with other common macros. */
#ifdef SUPPORT_CRYPTEQ
- read_macro_assignment("_HAVE_CRYPTEQ=y");
+ read_macro_assignment(US"_HAVE_CRYPTEQ=y");
#endif
#if HAVE_ICONV
- read_macro_assignment("_HAVE_ICONV=y");
+ read_macro_assignment(US"_HAVE_ICONV=y");
#endif
#if HAVE_IPV6
- read_macro_assignment("_HAVE_IPV6=y");
+ read_macro_assignment(US"_HAVE_IPV6=y");
#endif
#ifdef HAVE_SETCLASSRESOURCES
- read_macro_assignment("_HAVE_SETCLASSRESOURCES=y");
+ read_macro_assignment(US"_HAVE_SETCLASSRESOURCES=y");
#endif
#ifdef SUPPORT_PAM
- read_macro_assignment("_HAVE_PAM=y");
+ read_macro_assignment(US"_HAVE_PAM=y");
#endif
#ifdef EXIM_PERL
- read_macro_assignment("_HAVE_PERL=y");
+ read_macro_assignment(US"_HAVE_PERL=y");
#endif
#ifdef EXPAND_DLFUNC
- read_macro_assignment("_HAVE_DLFUNC=y");
+ read_macro_assignment(US"_HAVE_DLFUNC=y");
#endif
#ifdef USE_TCP_WRAPPERS
- read_macro_assignment("_HAVE_TCPWRAPPERS=y");
+ read_macro_assignment(US"_HAVE_TCPWRAPPERS=y");
#endif
#ifdef SUPPORT_TLS
- read_macro_assignment("_HAVE_TLS=y");
+ read_macro_assignment(US"_HAVE_TLS=y");
# ifdef USE_GNUTLS
- read_macro_assignment("_HAVE_GNUTLS=y");
+ read_macro_assignment(US"_HAVE_GNUTLS=y");
# else
- read_macro_assignment("_HAVE_OPENSSL=y");
+ read_macro_assignment(US"_HAVE_OPENSSL=y");
# endif
#endif
#ifdef SUPPORT_TRANSLATE_IP_ADDRESS
- read_macro_assignment("_HAVE_TRANSLATE_IP_ADDRESS=y");
+ read_macro_assignment(US"_HAVE_TRANSLATE_IP_ADDRESS=y");
#endif
#ifdef SUPPORT_MOVE_FROZEN_MESSAGES
- read_macro_assignment("_HAVE_MOVE_FROZEN_MESSAGES=y");
+ read_macro_assignment(US"_HAVE_MOVE_FROZEN_MESSAGES=y");
#endif
#ifdef WITH_CONTENT_SCAN
- read_macro_assignment("_HAVE_CONTENT_SCANNING=y");
+ read_macro_assignment(US"_HAVE_CONTENT_SCANNING=y");
#endif
#ifndef DISABLE_DKIM
- read_macro_assignment("_HAVE_DKIM=y");
+ read_macro_assignment(US"_HAVE_DKIM=y");
#endif
#ifndef DISABLE_DNSSEC
- read_macro_assignment("_HAVE_DNSSEC=y");
+ read_macro_assignment(US"_HAVE_DNSSEC=y");
#endif
#ifndef DISABLE_EVENT
- read_macro_assignment("_HAVE_Event=y");
+ read_macro_assignment(US"_HAVE_Event=y");
#endif
#ifdef SUPPORT_I18N
- read_macro_assignment("_HAVE_I18N=y");
+ read_macro_assignment(US"_HAVE_I18N=y");
#endif
#ifndef DISABLE_OCSP
- read_macro_assignment("_HAVE_OCSP=y");
+ read_macro_assignment(US"_HAVE_OCSP=y");
#endif
#ifndef DISABLE_PRDR
- read_macro_assignment("_HAVE_PRDR=y");
+ read_macro_assignment(US"_HAVE_PRDR=y");
#endif
#ifdef SUPPORT_PROXY
- read_macro_assignment("_HAVE_PROXY=y");
+ read_macro_assignment(US"_HAVE_PROXY=y");
#endif
#ifdef SUPPORT_SOCKS
- read_macro_assignment("_HAVE_SOCKS=y");
+ read_macro_assignment(US"_HAVE_SOCKS=y");
#endif
#ifdef EXPERIMENTAL_LMDB
- read_macro_assignment("_HAVE_LMDB=y");
+ read_macro_assignment(US"_HAVE_LMDB=y");
#endif
#ifdef EXPERIMENTAL_SPF
- read_macro_assignment("_HAVE_SPF=y");
+ read_macro_assignment(US"_HAVE_SPF=y");
#endif
#ifdef EXPERIMENTAL_SRS
- read_macro_assignment("_HAVE_SRS=y");
+ read_macro_assignment(US"_HAVE_SRS=y");
#endif
#ifdef EXPERIMENTAL_BRIGHTMAIL
- read_macro_assignment("_HAVE_BRIGHTMAIL=y");
+ read_macro_assignment(US"_HAVE_BRIGHTMAIL=y");
#endif
#ifdef EXPERIMENTAL_DANE
- read_macro_assignment("_HAVE_DANE=y");
+ read_macro_assignment(US"_HAVE_DANE=y");
#endif
#ifdef EXPERIMENTAL_DCC
- read_macro_assignment("_HAVE_DCC=y");
+ read_macro_assignment(US"_HAVE_DCC=y");
#endif
#ifdef EXPERIMENTAL_DMARC
- read_macro_assignment("_HAVE_DMARC=y");
+ read_macro_assignment(US"_HAVE_DMARC=y");
#endif
#ifdef EXPERIMENTAL_DSN_INFO
- read_macro_assignment("_HAVE_DSN_INFO=y");
+ read_macro_assignment(US"_HAVE_DSN_INFO=y");
#endif
#ifdef LOOKUP_LSEARCH
- read_macro_assignment("_HAVE_LKUP_LSEARCH=y");
+ read_macro_assignment(US"_HAVE_LKUP_LSEARCH=y");
#endif
#ifdef LOOKUP_CDB
- read_macro_assignment("_HAVE_LKUP_CDB=y");
+ read_macro_assignment(US"_HAVE_LKUP_CDB=y");
#endif
#ifdef LOOKUP_DBM
- read_macro_assignment("_HAVE_LKUP_DBM=y");
+ read_macro_assignment(US"_HAVE_LKUP_DBM=y");
#endif
#ifdef LOOKUP_DNSDB
- read_macro_assignment("_HAVE_LKUP_DNSDB=y");
+ read_macro_assignment(US"_HAVE_LKUP_DNSDB=y");
#endif
#ifdef LOOKUP_DSEARCH
- read_macro_assignment("_HAVE_LKUP_DSEARCH=y");
+ read_macro_assignment(US"_HAVE_LKUP_DSEARCH=y");
#endif
#ifdef LOOKUP_IBASE
- read_macro_assignment("_HAVE_LKUP_IBASE=y");
+ read_macro_assignment(US"_HAVE_LKUP_IBASE=y");
#endif
#ifdef LOOKUP_LDAP
- read_macro_assignment("_HAVE_LKUP_LDAP=y");
+ read_macro_assignment(US"_HAVE_LKUP_LDAP=y");
#endif
#ifdef EXPERIMENTAL_LMDB
- read_macro_assignment("_HAVE_LKUP_LMDB=y");
+ read_macro_assignment(US"_HAVE_LKUP_LMDB=y");
#endif
#ifdef LOOKUP_MYSQL
- read_macro_assignment("_HAVE_LKUP_MYSQL=y");
+ read_macro_assignment(US"_HAVE_LKUP_MYSQL=y");
#endif
#ifdef LOOKUP_NIS
- read_macro_assignment("_HAVE_LKUP_NIS=y");
+ read_macro_assignment(US"_HAVE_LKUP_NIS=y");
#endif
#ifdef LOOKUP_NISPLUS
- read_macro_assignment("_HAVE_LKUP_NISPLUS=y");
+ read_macro_assignment(US"_HAVE_LKUP_NISPLUS=y");
#endif
#ifdef LOOKUP_ORACLE
- read_macro_assignment("_HAVE_LKUP_ORACLE=y");
+ read_macro_assignment(US"_HAVE_LKUP_ORACLE=y");
#endif
#ifdef LOOKUP_PASSWD
- read_macro_assignment("_HAVE_LKUP_PASSWD=y");
+ read_macro_assignment(US"_HAVE_LKUP_PASSWD=y");
#endif
#ifdef LOOKUP_PGSQL
- read_macro_assignment("_HAVE_LKUP_PGSQL=y");
+ read_macro_assignment(US"_HAVE_LKUP_PGSQL=y");
#endif
#ifdef LOOKUP_REDIS
- read_macro_assignment("_HAVE_LKUP_REDIS=y");
+ read_macro_assignment(US"_HAVE_LKUP_REDIS=y");
#endif
#ifdef LOOKUP_SQLITE
- read_macro_assignment("_HAVE_LKUP_SQLITE=y");
+ read_macro_assignment(US"_HAVE_LKUP_SQLITE=y");
#endif
#ifdef LOOKUP_TESTDB
- read_macro_assignment("_HAVE_LKUP_TESTDB=y");
+ read_macro_assignment(US"_HAVE_LKUP_TESTDB=y");
#endif
#ifdef LOOKUP_WHOSON
- read_macro_assignment("_HAVE_LKUP_WHOSON=y");
+ read_macro_assignment(US"_HAVE_LKUP_WHOSON=y");
#endif
#ifdef AUTH_CRAM_MD5
- read_macro_assignment("_HAVE_AUTH_CRAM_MD5=y");
+ read_macro_assignment(US"_HAVE_AUTH_CRAM_MD5=y");
#endif
#ifdef AUTH_CYRUS_SASL
- read_macro_assignment("_HAVE_AUTH_CYRUS_SASL=y");
+ read_macro_assignment(US"_HAVE_AUTH_CYRUS_SASL=y");
#endif
#ifdef AUTH_DOVECOT
- read_macro_assignment("_HAVE_AUTH_DOVECOT=y");
+ read_macro_assignment(US"_HAVE_AUTH_DOVECOT=y");
#endif
#ifdef AUTH_GSASL
- read_macro_assignment("_HAVE_AUTH_GSASL=y");
+ read_macro_assignment(US"_HAVE_AUTH_GSASL=y");
#endif
#ifdef AUTH_HEIMDAL_GSSAPI
- read_macro_assignment("_HAVE_AUTH_HEIMDAL_GSSAPI=y");
+ read_macro_assignment(US"_HAVE_AUTH_HEIMDAL_GSSAPI=y");
#endif
#ifdef AUTH_PLAINTEXT
- read_macro_assignment("_HAVE_AUTH_PLAINTEXT=y");
+ read_macro_assignment(US"_HAVE_AUTH_PLAINTEXT=y");
#endif
#ifdef AUTH_SPA
- read_macro_assignment("_HAVE_AUTH_SPA=y");
+ read_macro_assignment(US"_HAVE_AUTH_SPA=y");
#endif
#ifdef AUTH_TLS
- read_macro_assignment("_HAVE_AUTH_TLS=y");
+ read_macro_assignment(US"_HAVE_AUTH_TLS=y");
#endif
#ifdef ROUTER_ACCEPT
- read_macro_assignment("_HAVE_RTR_ACCEPT=y");
+ read_macro_assignment(US"_HAVE_RTR_ACCEPT=y");
#endif
#ifdef ROUTER_DNSLOOKUP
- read_macro_assignment("_HAVE_RTR_DNSLOOKUP=y");
+ read_macro_assignment(US"_HAVE_RTR_DNSLOOKUP=y");
#endif
#ifdef ROUTER_IPLITERAL
- read_macro_assignment("_HAVE_RTR_IPLITERAL=y");
+ read_macro_assignment(US"_HAVE_RTR_IPLITERAL=y");
#endif
#ifdef ROUTER_IPLOOKUP
- read_macro_assignment("_HAVE_RTR_IPLOOKUP=y");
+ read_macro_assignment(US"_HAVE_RTR_IPLOOKUP=y");
#endif
#ifdef ROUTER_MANUALROUTE
- read_macro_assignment("_HAVE_RTR_MANUALROUTE=y");
+ read_macro_assignment(US"_HAVE_RTR_MANUALROUTE=y");
#endif
#ifdef ROUTER_QUERYPROGRAM
- read_macro_assignment("_HAVE_RTR_QUERYPROGRAM=y");
+ read_macro_assignment(US"_HAVE_RTR_QUERYPROGRAM=y");
#endif
#ifdef ROUTER_REDIRECT
- read_macro_assignment("_HAVE_RTR_REDRCT=y");
+ read_macro_assignment(US"_HAVE_RTR_REDRCT=y");
#endif
#ifdef TRANSPORT_APPENDFILE
- read_macro_assignment("_HAVE_TPT_APPENDFILE=y");
+ read_macro_assignment(US"_HAVE_TPT_APPENDFILE=y");
# ifdef SUPPORT_MAILDIR
- read_macro_assignment("_HAVE_TPT_APPEND_MAILDR=y");
+ read_macro_assignment(US"_HAVE_TPT_APPEND_MAILDR=y");
# endif
# ifdef SUPPORT_MAILSTORE
- read_macro_assignment("_HAVE_TPT_APPEND_MAILSTORE=y");
+ read_macro_assignment(US"_HAVE_TPT_APPEND_MAILSTORE=y");
# endif
# ifdef SUPPORT_MBX
- read_macro_assignment("_HAVE_TPT_APPEND_MBX=y");
+ read_macro_assignment(US"_HAVE_TPT_APPEND_MBX=y");
# endif
#endif
#ifdef TRANSPORT_AUTOREPLY
- read_macro_assignment("_HAVE_TPT_AUTOREPLY=y");
+ read_macro_assignment(US"_HAVE_TPT_AUTOREPLY=y");
#endif
#ifdef TRANSPORT_LMTP
- read_macro_assignment("_HAVE_TPT_LMTP=y");
+ read_macro_assignment(US"_HAVE_TPT_LMTP=y");
#endif
#ifdef TRANSPORT_PIPE
- read_macro_assignment("_HAVE_TPT_PIPE=y");
+ read_macro_assignment(US"_HAVE_TPT_PIPE=y");
#endif
#ifdef TRANSPORT_SMTP
- read_macro_assignment("_HAVE_TPT_SMTP=y");
+ read_macro_assignment(US"_HAVE_TPT_SMTP=y");
#endif
}
else
{
clearerr(mime_stream);
- fseek(mime_stream, f_pos, SEEK_SET);
+ if (fseek(mime_stream, f_pos, SEEK_SET) == -1)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "regex acl condition: mime_stream: %s", strerror(errno));
+ clearerr(mime_stream);
+ }
}
return ret;
-1 no string list found
*/
-static int parse_stringlist(struct Sieve *filter, struct String **data)
+static int
+parse_stringlist(struct Sieve *filter, struct String **data)
{
const uschar *orig=filter->pc;
-int dataCapacity=0;
-int dataLength=0;
-struct String *d=(struct String*)0;
+int dataCapacity = 0;
+int dataLength = 0;
+struct String *d = NULL;
int m;
if (*filter->pc=='[') /* string list */
for (;;)
{
if (parse_white(filter)==-1) goto error;
- if ((dataLength+1)>=dataCapacity) /* increase buffer */
+ if (dataLength+1 >= dataCapacity) /* increase buffer */
{
struct String *new;
int newCapacity; /* Don't amalgamate with next line; some compilers grumble */
- newCapacity=dataCapacity?(dataCapacity*=2):(dataCapacity=4);
- if ((new=(struct String*)store_get(sizeof(struct String)*newCapacity))==(struct String*)0)
- {
- filter->errmsg=CUstrerror(errno);
- goto error;
- }
+
+ dataCapacity = dataCapacity ? dataCapacity * 2 : 4;
+ new = store_get(sizeof(struct String) * dataCapacity);
+
if (d) memcpy(new,d,sizeof(struct String)*dataLength);
- d=new;
- dataCapacity=newCapacity;
+ d = new;
}
+
m=parse_string(filter,&d[dataLength]);
if (m==0)
{
uschar * fname;
int save_errno;
- message_subdir[0] = split_spool_directory == i == 0 ? id[5] : 0;
+ message_subdir[0] = split_spool_directory == i ? '\0' : id[5];
fname = spool_fname(US"input", message_subdir, id, US"-D");
DEBUG(D_deliver) debug_printf("Trying spool file %s\n", fname);
else if (Ustrncmp(p, "cl ", 3) == 0)
{
- int index, count;
- uschar name[20]; /* Need plenty of space for %d format */
- tree_node *node;
- if ( sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2
+ unsigned index, count;
+ uschar name[20]; /* Need plenty of space for %u format */
+ tree_node * node;
+ if ( sscanf(CS big_buffer + 5, "%u %u", &index, &count) != 2
|| index >= 20
)
goto SPOOL_FORMAT_ERROR;
if (index < 10)
- (void) string_format(name, sizeof(name), "%c%d", 'c', index);
+ (void) string_format(name, sizeof(name), "%c%u", 'c', index);
else
- (void) string_format(name, sizeof(name), "%c%d", 'm', index - 10);
+ (void) string_format(name, sizeof(name), "%c%u", 'm', index - 10);
node = acl_var_create(name);
node->data.ptr = store_get(count + 1);
if (fread(node->data.ptr, 1, count+1, f) < count) goto SPOOL_READ_ERROR;
- ((uschar*)node->data.ptr)[count] = 0;
+ (US node->data.ptr)[count] = '\0';
}
break;
{
uschar *mbox_path;
uschar *file_path;
- int n;
struct dirent *entry;
DIR *tempdir;
while((entry = readdir(tempdir)) != NULL)
{
uschar *name = US entry->d_name;
+ int dummy;
if (Ustrcmp(name, US".") == 0 || Ustrcmp(name, US"..") == 0) continue;
file_path = string_sprintf("%s/%s", mbox_path, name);
debug_printf("unspool_mbox(): unlinking '%s'\n", file_path);
- n = unlink(CS file_path);
+ dummy = unlink(CS file_path);
}
closedir(tempdir);
name = X509_get_subject_name(x509);
X509_NAME_add_entry_by_txt(name, "C",
- MBSTRING_ASC, "UK", -1, -1, 0);
+ MBSTRING_ASC, CUS "UK", -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "O",
- MBSTRING_ASC, "Exim Developers", -1, -1, 0);
+ MBSTRING_ASC, CUS "Exim Developers", -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "CN",
- MBSTRING_ASC, CS smtp_active_hostname, -1, -1, 0);
+ MBSTRING_ASC, CUS smtp_active_hostname, -1, -1, 0);
X509_set_issuer_name(x509, name);
where = US"signing cert";
if (tctx->options & topt_use_bdat)
{
off_t fsize;
- int hsize, size;
+ int hsize, size = 0;
if ((hsize = chunk_ptr - deliver_out_buffer) < 0)
hsize = 0;
/* Send file down the original fd */
while((sread = read(dkim_fd, deliver_out_buffer, DELIVER_OUT_BUFFER_SIZE)) >0)
{
- char *p = deliver_out_buffer;
+ uschar * p = deliver_out_buffer;
/* write the chunk */
while (sread)
{
#ifdef SUPPORT_TLS
wwritten = tls_out.active == out_fd
- ? tls_write(FALSE, US p, sread)
- : write(out_fd, p, sread);
+ ? tls_write(FALSE, p, sread)
+ : write(out_fd, CS p, sread);
#else
- wwritten = write(out_fd, p, sread);
+ wwritten = write(out_fd, CS p, sread);
#endif
if (wwritten == -1)
goto err;
BOOL
transport_write_message(int fd, transport_ctx * tctx, int size_limit)
{
-unsigned wck_flags;
BOOL last_filter_was_NL = TRUE;
int rc, len, yield, fd_read, fd_write, save_errno;
int pfd[2] = {-1, -1};
before being written to the incoming fd. First set up the special processing to
be done during the copying. */
-wck_flags = tctx->options & topt_use_crlf;
nl_partial_match = -1;
if (tctx->check_string && tctx->escape_string)
{
rc = child_close(write_pid, 30);
if (yield)
- {
if (rc == 0)
{
BOOL ok;
- int dummy = read(pfd[pipe_read], (void *)&ok, sizeof(BOOL));
- if (!ok)
+ if (read(pfd[pipe_read], (void *)&ok, sizeof(BOOL)) != sizeof(BOOL))
+ {
+ DEBUG(D_transport)
+ debug_printf("pipe read from writing process: %s\n", strerror(errno));
+ save_errno = ERRNO_FILTER_FAIL;
+ yield = FALSE;
+ }
+ else if (!ok)
{
- dummy = read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
+ int dummy = read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
dummy = read(pfd[pipe_read], (void *)&(tctx->addr->more_errno), sizeof(int));
yield = FALSE;
}
tctx->addr->more_errno = rc;
DEBUG(D_transport) debug_printf("writing process returned %d\n", rc);
}
- }
}
(void)close(pfd[pipe_read]);
lflags.setting_up = TRUE;
lflags.esmtp = TRUE;
lflags.esmtp_sent = FALSE;
-lflags.pending_MAIL;
#ifndef DISABLE_PRDR
lflags.prdr_active;
#endif
int oldtimeout = ob->command_timeout;
int rc;
- tls_negotiate:
ob->command_timeout = callout;
rc = tls_client_start(inblock.sock, host, addr, addr->transport
# ifdef EXPERIMENTAL_DANE