From: Jeremy Harris Date: Thu, 21 Jul 2016 13:38:48 +0000 (+0100) Subject: tidying: dkim output buffer X-Git-Tag: exim-4_88_RC1~52^2~11 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e520153e6c5035b99c25e2d6b7530237d9dbfa49;p=exim.git tidying: dkim output buffer --- diff --git a/src/src/transport.c b/src/src/transport.c index 3c1b00501..4675a2c56 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -998,6 +998,7 @@ uschar * dkim_spool_name; int sread = 0; int wwritten = 0; uschar *dkim_signature = NULL; +int siglen; off_t k_file_size; /* If we can't sign, just call the original function. */ @@ -1062,28 +1063,30 @@ if (dkim->dkim_private_key && dkim->dkim_domain && dkim->dkim_selector) } } - if (dkim_signature) + siglen = 0; + } + +if (dkim_signature) + { + siglen = Ustrlen(dkim_signature); + while(siglen > 0) { - int siglen = Ustrlen(dkim_signature); - while(siglen > 0) - { #ifdef SUPPORT_TLS - wwritten = tls_out.active == out_fd - ? tls_write(FALSE, dkim_signature, siglen) - : write(out_fd, dkim_signature, siglen); + wwritten = tls_out.active == out_fd + ? tls_write(FALSE, dkim_signature, siglen) + : write(out_fd, dkim_signature, siglen); #else - wwritten = write(out_fd, dkim_signature, siglen); + wwritten = write(out_fd, dkim_signature, siglen); #endif - if (wwritten == -1) - { - /* error, bail out */ - save_errno = errno; - rc = FALSE; - goto CLEANUP; - } - siglen -= wwritten; - dkim_signature += wwritten; + if (wwritten == -1) + { + /* error, bail out */ + save_errno = errno; + rc = FALSE; + goto CLEANUP; } + siglen -= wwritten; + dkim_signature += wwritten; } }