]> diplodocus.org Git - nmh/blobdiff - sbr/ruserpass.c
showfile.c: Move interface to own file.
[nmh] / sbr / ruserpass.c
index 513fb117e091792100a02baef0b1f1b04ffe0494..55694c82747fb56c705ea64a9f068a9f24860654 100644 (file)
  * distribution for complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "getpass.h"
+#include "ruserpass.h"
+#include "credentials.h"
+#include "error.h"
+#include "h/utils.h"
 #include <pwd.h>
 
 static FILE *cfile;
@@ -64,7 +68,7 @@ static int token(char *);
 void
 ruserpass(const char *host, char **aname, char **apass, int flags)
 {
-    int t, usedefault = 0;
+    int t;
     struct stat stb;
 
     init_credentials_file ();
@@ -77,10 +81,11 @@ ruserpass(const char *host, char **aname, char **apass, int flags)
         char tokval[MAX_TOKVAL_SIZE];
         tokval[0] = '\0';
 
+        bool usedefault = false;
        while ((t = token(tokval))) {
            switch(t) {
            case DEFAULT:
-               usedefault = 1;
+               usedefault = true;
                /* FALLTHRU */
 
            case MACH: