]> diplodocus.org Git - nmh/blobdiff - sbr/credentials.c
prevent spurious errors when requesting specific message parts
[nmh] / sbr / credentials.c
index 2b9e843e6c5b79aeee9dc5363c10bb45acb186d9..ff4ee84e03198bf5b9955c06e4bce2b50d2406f0 100644 (file)
@@ -21,7 +21,7 @@ init_credentials_file () {
             struct stat st;
             char *filename = cred_style + 5;
 
-            while (*filename  &&  isspace ((int) *filename)) ++filename;
+            while (*filename && isspace ((unsigned char) *filename)) ++filename;
 
             if (*filename == '/') {
                 credentials_file = filename;
@@ -48,10 +48,11 @@ nmh_get_credentials (char *host, char *user, int sasl, nmh_creds_t creds) {
     creds->host = host;
 
     if (cred_style == NULL  ||  ! strcmp (cred_style, "legacy")) {
+       creds->user = user == NULL  ?  getusername ()  :  user;
         if (sasl) {
+
             /* This is what inc.c and msgchk.c used to contain. */
             /* Only inc.c and msgchk.c do this.  smtp.c doesn't. */
-            creds->user = user == NULL  ?  getusername ()  :  user;
             creds->password = getusername ();
         }
     } else if (! strncasecmp (cred_style, "file:", 5)) {