]> granicus.if.org Git - neomutt/commitdiff
standardise infinite loops
authorRichard Russon <rich@flatcap.org>
Fri, 24 Nov 2017 14:13:02 +0000 (14:13 +0000)
committerRichard Russon <rich@flatcap.org>
Sun, 26 Nov 2017 22:37:25 +0000 (22:37 +0000)
charset.c
enter.c
handler.c
ncrypt/crypt_gpgme.c
rfc2047.c
safe_asprintf.c
sendlib.c

index 407fd7c9cdf7347c569fac0a944382bb81fdf359..71376a360c5aff15f82b356df375d26fc975b614 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -374,7 +374,7 @@ size_t mutt_iconv(iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft,
   char *ob = *outbuf;
   size_t obl = *outbytesleft;
 
-  for (;;)
+  while (true)
   {
     ret1 = iconv(cd, &ib, &ibl, &ob, &obl);
     if (ret1 != (size_t) -1)
diff --git a/enter.c b/enter.c
index 55980f1a7ede4556fa6d477210732f4aea04191a..1b9fab773676db21d62e959d1be36530f5b7b7c2 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -195,7 +195,7 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul
   else
     hclass = HC_OTHER;
 
-  for (;;)
+  while (true)
   {
     if (redraw && !pass)
     {
index 5515b81660dc60b9daad6c3b18a5fc727ff28706..766ec2e6b03935f8ee8671fef8fc8875f39025d6 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -117,7 +117,7 @@ static void convert_to_state(iconv_t cd, char *bufi, size_t *l, struct State *s)
 
   ib = bufi;
   ibl = *l;
-  for (;;)
+  while (true)
   {
     ob = bufo, obl = sizeof(bufo);
     mutt_iconv(cd, &ib, &ibl, &ob, &obl, 0, "?");
index 07d29d92baab9752b9f1c2fff229511f01b369a6..8bb0c6ed550c9839bcd531aab744b68fc2e5effa 100644 (file)
@@ -4548,7 +4548,7 @@ static struct CryptKeyInfo *crypt_ask_for_key(char *tag, char *whatfor, short ab
       }
   }
 
-  for (;;)
+  while (true)
   {
     resp[0] = 0;
     if (mutt_get_field(tag, resp, sizeof(resp), MUTT_CLEAR) != 0)
index 8d7aaaa08f1ec3f82964e115a0819ef4ac4b5b8d..c451f5ac3b20f324ff4064d3e504521de8bc1d32 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -390,7 +390,7 @@ static size_t choose_block(char *d, size_t dlen, int col, const char *fromcode,
   int utf8 = fromcode && (mutt_str_strcasecmp(fromcode, "utf-8") == 0);
 
   n = dlen;
-  for (;;)
+  while (true)
   {
     assert(d + n > d);
     nn = try_block(d, n, fromcode, tocode, encoder, wlen);
@@ -544,7 +544,7 @@ static int rfc2047_encode(ICONV_CONST char *d, size_t dlen, int col, const char
   col += t0 - u;
 
   t = t0;
-  for (;;)
+  while (true)
   {
     /* Find how much we can encode. */
     n = choose_block(t, t1 - t, col, icode, tocode, &encoder, &wlen);
index 56e51f532db931f609fddb6775a6b3c9e5e52dcd..580f409849eddc3d4da037fe1ad0de8b0aeff9f5 100644 (file)
@@ -70,7 +70,7 @@ int safe_asprintf(char **strp, const char *fmt, ...)
   int n;
 
   *strp = mutt_mem_malloc(rlen);
-  for (;;)
+  while (true)
   {
     va_list ap;
     va_start(ap, fmt);
index 26223db3ec5ab4a83215c56042443889c6e58dcd..c6a6d255f34b7af1da553062d3c63a2227f1169c 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -713,7 +713,7 @@ static size_t convert_file_to(FILE *file, const char *fromcode, int ncodes,
 
   rewind(file);
   ibl = 0;
-  for (;;)
+  while (true)
   {
     /* Try to fill input buffer */
     n = fread(bufi + ibl, 1, sizeof(bufi) - ibl, file);