Fix bug in passphrase flushing loop.
authormdw <mdw>
Wed, 22 Dec 1999 22:13:42 +0000 (22:13 +0000)
committermdw <mdw>
Wed, 22 Dec 1999 22:13:42 +0000 (22:13 +0000)
pixie.c

diff --git a/pixie.c b/pixie.c
index ee7d953..f41ea27 100644 (file)
--- a/pixie.c
+++ b/pixie.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: pixie.c,v 1.1 1999/12/22 15:58:41 mdw Exp $
+ * $Id: pixie.c,v 1.2 1999/12/22 22:13:42 mdw Exp $
  *
  * Passphrase pixie for Catacomb
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: pixie.c,v $
+ * Revision 1.2  1999/12/22 22:13:42  mdw
+ * Fix bug in passphrase flushing loop.
+ *
  * Revision 1.1  1999/12/22 15:58:41  mdw
  * Passphrase pixie support.
  *
@@ -311,7 +314,9 @@ static void p_flush(const char *tag)
 
   if (!tag && verbose > 1)
     log("flushing all passphrases");
-  for (p = P_ROOT->next; p != P_ROOT; p = p->next) {
+  p = P_ROOT->next;
+  while (p != P_ROOT) {
+    phrase *pp = p->next;
     if (!tag)
       p_free(p);
     else if (strcmp(p->tag, tag) == 0) {
@@ -320,6 +325,7 @@ static void p_flush(const char *tag)
       p_free(p);
       break;
     }
+    p = pp;
   }
 }