]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Turn a while into a do/while; save a redundant test
authorNick Mathewson <nickm@torproject.org>
Sat, 24 Jun 2006 02:10:21 +0000 (02:10 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 24 Jun 2006 02:10:21 +0000 (02:10 +0000)
svn:r6683

src/or/buffers.c

index db740fbce23f36bf8cd34c85098564b0e971690f..86741e9733b189d07d5d0be6784bd8671723ade3 100644 (file)
@@ -1299,7 +1299,7 @@ write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
   char *next;
   size_t old_avail, avail;
   int over = 0;
-  while (!over) {
+  do {
     buf_ensure_capacity(buf, buf->datalen + 1024);
     next = _buf_end(buf);
     if (next < buf->cur)
@@ -1339,7 +1339,7 @@ write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
     if (buf->datalen > buf->highwater)
       buf->highwater = buf->datalen;
     buf_total_used += old_avail - avail;
-  }
+  } while (!over);
   return 0;
 }