]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: ostream-wrapper - Fix dead assignments.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 20 Apr 2020 22:13:16 +0000 (00:13 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 25 Apr 2020 11:10:12 +0000 (13:10 +0200)
Found by Clang scan-build.

src/lib/ostream-wrapper.c

index 55aa017b953f95c0064bed1056b7b61dae20a02d..62416430e3845daf33ca8290f0a150dd9b8d623a 100644 (file)
@@ -398,7 +398,6 @@ wrapper_ostream_writev_full(struct wrapper_ostream *wostream,
 
        /* Blocking; loop and wait until all is sent */
 
-       i = 0;
        sent_total = 0;
        for (;;) {
                struct const_iovec niov;
@@ -641,11 +640,10 @@ wrapper_ostream_sendv_real(struct wrapper_ostream *wostream,
 
        /* Determine total size of data to send */
        size = 0;
-       for (i = 0, size = 0; i < iov_count; i++)
+       for (i = 0; i < iov_count; i++)
                size += iov[i].iov_len;
 
        /* Flush buffer if required */
-       ret = 1;
        if (!wrapper_ostream_is_empty(wostream) &&
            (!stream->corked || wrapper_ostream_is_filled(wostream)) &&
            wrapper_ostream_send_prepare(wostream, size) &&