X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..01fd4094faf9fa892faad3621433e5faa98157f9:/sbr/credentials.c diff --git a/sbr/credentials.c b/sbr/credentials.c index 3aba7d80..b610b2b9 100644 --- a/sbr/credentials.c +++ b/sbr/credentials.c @@ -1,4 +1,6 @@ -/* This code is Copyright (c) 2013, by the authors of nmh. See the +/* credentials.c -- wrap configurable access to .netrc or similar files. + * + * This code is Copyright (c) 2013, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ @@ -6,6 +8,7 @@ #include #include #include +#include "m_maildir.h" struct nmh_creds { char *host; /* Hostname corresponding to credentials */ @@ -14,7 +17,7 @@ struct nmh_creds { }; void -init_credentials_file () { +init_credentials_file(void) { if (credentials_file == NULL) { char *cred_style = context_find ("credentials"); @@ -27,7 +30,8 @@ init_credentials_file () { struct stat st; char *filename = strchr(cred_style, ':') + 1; - while (*filename && isspace ((unsigned char) *filename)) ++filename; + while (isspace((unsigned char)*filename)) + filename++; if (*filename == '/') { credentials_file = filename; @@ -124,8 +128,8 @@ nmh_cred_get_password(nmh_creds_t creds) void nmh_credentials_free(nmh_creds_t creds) { - mh_xfree(creds->host); - mh_xfree(creds->user); + free(creds->host); + free(creds->user); if (creds->pass) { memset(creds->pass, 0, strlen(creds->pass));