struct stat statbuf;
sprintf(CS big_buffer, "%s/input/%s", spool_directory, buffer);
if (Ustat(big_buffer, &statbuf) == 0)
- msg = string_sprintf("*** Format error in spool file: size = %d ***",
+ msg = string_sprintf("*** Format error in spool file: size = " OFF_T_FMT " ***",
statbuf.st_size);
else msg = US"*** Format error in spool file ***";
}
pdkim_pubkey * p;
if (!(dns_txt = dkim_exim_query_dns_txt(string_sprintf("%.*s._domainkey.%.*s",
- al->s.len, al->s.data, al->d.len, al->d.data))))
+ (int)al->s.len, al->s.data, (int)al->d.len, al->d.data))))
{
DEBUG(D_acl) debug_printf("pubkey dns lookup fail\n");
return NULL;
#include "exim.h"
-
/*************************************************
* Fake DNS resolver *
*************************************************/
/* Skip the SOA serial, refresh, retry & expire. Grab the TTL */
- if (p > dnsa->answer + dnsa->answerlen - 5 * NS_INT32SZ)
+ if (p > dnsa->answer + dnsa->answerlen - 5 * INT32SZ)
break;
- p += 4 * NS_INT32SZ;
+ p += 4 * INT32SZ;
GETLONG(ttl, p);
return time(NULL) + ttl;
static int
host_name_lookup_byaddr(void)
{
-int len;
-uschar *s, *t;
-struct hostent *hosts;
+struct hostent * hosts;
struct in_addr addr;
unsigned long time_msec = 0; /* init to quieten dumb static analysis */
const uschar *
exim_dkim_signing_init(const uschar * privkey_pem, es_ctx * sign_ctx)
{
-BIO * bp = BIO_new_mem_buf(privkey_pem, -1);
+BIO * bp = BIO_new_mem_buf((void *)privkey_pem, -1);
if (!(sign_ctx->key = PEM_read_bio_PrivateKey(bp, NULL, NULL, NULL)))
return string_sprintf("privkey PEM-block import: %s",
got set above. Of course, writing to the log may not work if log_file_path is
not set, but it will at least get to syslog or somewhere, with any luck. */
-if (*spool_directory == 0)
+if (!*spool_directory)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "spool_directory undefined: cannot "
"proceed");
/* Expand the spool directory name; it may, for example, contain the primary
host name. Same comment about failure. */
-s = expand_string(spool_directory);
-if (s == NULL)
+if (!(s = expand_string(spool_directory)))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to expand spool_directory "
"\"%s\": %s", spool_directory, expand_string_message);
spool_directory = s;
the null string or "syslog". It is also allowed to contain one instance of %D
or %M. However, it must NOT contain % followed by anything else. */
-if (*log_file_path != 0)
+if (*log_file_path)
{
const uschar *ss, *sss;
int sep = ':'; /* Fixed for log file path */
- s = expand_string(log_file_path);
- if (s == NULL)
+ if (!(s = expand_string(log_file_path)))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "failed to expand log_file_path "
"\"%s\": %s", log_file_path, expand_string_message);
ss = s;
- while ((sss = string_nextinlist(&ss,&sep,big_buffer,big_buffer_size)) != NULL)
+ while ((sss = string_nextinlist(&ss, &sep, big_buffer, big_buffer_size)))
{
uschar *t;
if (sss[0] == 0 || Ustrcmp(sss, "syslog") == 0) continue;
- t = Ustrstr(sss, "%s");
- if (t == NULL)
+ if (!(t = Ustrstr(sss, "%s")))
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "log_file_path \"%s\" does not "
"contain \"%%s\"", sss);
*t = 'X';
- t = Ustrchr(sss, '%');
- if (t != NULL)
- {
+ if ((t = Ustrchr(sss, '%')))
if ((t[1] != 'D' && t[1] != 'M') || Ustrchr(t+2, '%') != NULL)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "log_file_path \"%s\" contains "
"unexpected \"%%\" character", s);
- }
}
log_file_path = s;
if (!(key = tk_current())) /* current key doesn't exist or isn't valid */
return 0; /* key couldn't be created */
memcpy(key_name, key->name, 16);
- DEBUG(D_tls) debug_printf("STEK expire %ld\n", key->expire - time(NULL));
+ DEBUG(D_tls) debug_printf("STEK expire " TIME_T_FMT "\n", key->expire - time(NULL));
/*XXX will want these dependent on the ssl session strength */
HMAC_Init_ex(hctx, key->hmac_key, sizeof(key->hmac_key),
DEBUG(D_tls)
{
debug_printf("ticket not usable (%s)\n", key ? "expired" : "not found");
- if (key) debug_printf("STEK expire %ld\n", key->expire - now);
+ if (key) debug_printf("STEK expire " TIME_T_FMT "\n", key->expire - now);
}
return 0;
}
key->hmac_hash, NULL);
EVP_DecryptInit_ex(ctx, key->aes_cipher, NULL, key->aes_key, iv);
- DEBUG(D_tls) debug_printf("ticket usable, STEK expire %ld\n", key->expire - now);
+ DEBUG(D_tls) debug_printf("ticket usable, STEK expire " TIME_T_FMT "\n", key->expire - now);
/* The ticket lifetime and renewal are the same as the STEK lifetime and
renewal, which is overenthusiastic. A factor of, say, 3x longer STEK would