Gather up another utility.
[u/mdw/catacomb] / passphrase.c
index e19aed4..0b8ddcf 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: passphrase.c,v 1.2 2000/06/17 11:49:37 mdw Exp $
+ * $Id: passphrase.c,v 1.6 2004/04/08 01:36:15 mdw Exp $
  *
  * Reading of passphrases (Unix-specific)
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: passphrase.c,v $
- * Revision 1.2  2000/06/17 11:49:37  mdw
- * New pixie protocol allowing application to request passphrases and send
- * them to the pixie.
- *
- * Revision 1.1  1999/12/22 15:58:20  mdw
- * Portable interface to reading passphrases.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include <errno.h>
@@ -58,9 +46,7 @@
 static int fd = -1;
 static unsigned flags = 0;
 
-enum {
-  f_fail = 1
-};
+#define f_fail 1u
 
 /*----- Main code ---------------------------------------------------------*/
 
@@ -129,8 +115,7 @@ int passphrase_read(const char *tag, unsigned mode, char *buf, size_t sz)
     char b[1024];
     DRESET(&d);
     dstr_putf(&d, "Verify passphrase %s: ", tag);
-    if (pixie_getpass(d.buf, b, sizeof(b)) ||
-       strcmp(b, buf) != 0) {
+    if (pixie_getpass(d.buf, b, sizeof(b)) || strcmp(b, buf) != 0) {
       memset(b, 0, sizeof(b));
       goto fail;
     }