From bc3edaa6ad1a511075a97eab0bbb19a26b2288d2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 19 Dec 2012 10:37:08 +0100 Subject: s4-libcli: Use a do-while loop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source4/libcli/clireadwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index ae2367918c..7d8f34a428 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -105,8 +105,8 @@ ssize_t smbcli_write(struct smbcli_tree *tree, parms.writex.in.file.fnum = fnum; parms.writex.in.wmode = write_mode; parms.writex.in.remaining = 0; - - while (total < size) { + + do { NTSTATUS status; block = MIN(block, size - total); @@ -124,7 +124,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, offset += parms.writex.out.nwritten; total += parms.writex.out.nwritten; buf += parms.writex.out.nwritten; - } + } while (total < size); return total; } -- cgit