-/*
+/* 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.
#include <h/mh.h>
#include <h/utils.h>
#include <h/mts.h>
+#include "m_maildir.h"
struct nmh_creds {
char *host; /* Hostname corresponding to credentials */
};
void
-init_credentials_file () {
+init_credentials_file(void) {
if (credentials_file == NULL) {
char *cred_style = context_find ("credentials");
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;
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));