]> granicus.if.org Git - neomutt/commitdiff
Fix empty In-Reply-To generation (#716)
authorPietro Cerutti <gahr@gahr.ch>
Wed, 9 Aug 2017 15:48:49 +0000 (16:48 +0100)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2017 15:48:49 +0000 (16:48 +0100)
Fixes #715

sendlib.c

index b8781dccd31b842b7621dab9b071ee5108f4fcc1..857195b505c8500f28bf54c63ea1e91fc4d4df5d 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1600,10 +1600,11 @@ void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim)
   struct ListNode **ref = safe_calloc(length, sizeof(struct ListNode*));
 
   // store in reverse order
+  size_t tmp = length;
   STAILQ_FOREACH(np, r, entries)
   {
-    ref[--length] = np;
-    if (length == 0)
+    ref[--tmp] = np;
+    if (tmp == 0)
       break;
   }