summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-19 10:37:08 +0100
committerGünther Deschner <gd@samba.org>2012-12-21 13:56:01 +0100
commitbc3edaa6ad1a511075a97eab0bbb19a26b2288d2 (patch)
tree4d492cfaec3cb919c96138dff2f092b10dbb7c63
parent9c273d5ca1810da8cf03a2af78b3fa5cbaaf2df7 (diff)
downloadsamba-bc3edaa6ad1a511075a97eab0bbb19a26b2288d2.tar.gz
samba-bc3edaa6ad1a511075a97eab0bbb19a26b2288d2.tar.bz2
samba-bc3edaa6ad1a511075a97eab0bbb19a26b2288d2.zip
s4-libcli: Use a do-while loop.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
-rw-r--r--source4/libcli/clireadwrite.c6
1 files changed, 3 insertions, 3 deletions
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;
}