From: David Levine Date: Mon, 7 May 2012 21:35:16 +0000 (-0500) Subject: Fixed some more problems caught by gcc -ansi -pedantic. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=c4d932d08940f689b39b654a714f9ef3657690a9;p=mmh Fixed some more problems caught by gcc -ansi -pedantic. --- diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index ba9938a..c18b89b 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -1115,12 +1115,12 @@ static int sm_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { - NMH_UNUSED (conn); - char **pw_context = (char **) context; char *pass = NULL; int len; + NMH_UNUSED (conn); + if (! psecret || id != SASL_CB_PASS) return SASL_BADPARAM; diff --git a/sbr/getansreadline.c b/sbr/getansreadline.c index 26a0574..2fd0618 100644 --- a/sbr/getansreadline.c +++ b/sbr/getansreadline.c @@ -175,10 +175,10 @@ initialize_readline(void) static char ** nmh_completion(const char *text, int start, int end) { - NMH_UNUSED (end); - char **matches; + NMH_UNUSED (end); + matches = (char **) NULL; if (start == 0) diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index 9f99119..c08f614 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -130,7 +130,7 @@ m_mktemp2 ( static char * get_temp_dir() { - // Ignore envvars if we are setuid + /* Ignore envvars if we are setuid */ if ((getuid()==geteuid()) && (getgid()==getegid())) { char *tmpdir = NULL; tmpdir = getenv("MHTMPDIR"); diff --git a/uip/mhparse.c b/uip/mhparse.c index 8035113..4c3a194 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1776,8 +1776,8 @@ openBase64 (CT ct, char **file) } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { - // Temporary file already exists, so we rename to - // version with extension. + /* Temporary file already exists, so we rename to + version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { @@ -2008,8 +2008,8 @@ openQuoted (CT ct, char **file) } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { - // Temporary file already exists, so we rename to - // version with extension. + /* Temporary file already exists, so we rename to + version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { @@ -2232,8 +2232,8 @@ open7Bit (CT ct, char **file) } if (cp != NULL && *cp != '\0') { if (ce->ce_unlink) { - // Temporary file already exists, so we rename to - // version with extension. + /* Temporary file already exists, so we rename to + version with extension. */ char *file_org = strdup(ce->ce_file); ce->ce_file = add (cp, ce->ce_file); if (rename(file_org, ce->ce_file)) { diff --git a/uip/picksbr.c b/uip/picksbr.c index b92c053..4073919 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -80,7 +80,7 @@ static struct swit parswit[] = { static char linebuf[LBSIZE + 1]; /* the magic array for case-independence */ -static char cc[] = { +static unsigned char cc[] = { 0000,0001,0002,0003,0004,0005,0006,0007, 0010,0011,0012,0013,0014,0015,0016,0017, 0020,0021,0022,0023,0024,0025,0026,0027, diff --git a/uip/popsbr.c b/uip/popsbr.c index ff28705..c566264 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -343,12 +343,12 @@ sasl_get_user(void *context, int id, const char **result, unsigned *len) static int sasl_get_pass(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret) { - NMH_UNUSED (conn); - struct pass_context *p_context = (struct pass_context *) context; char *pass = NULL; int len; + NMH_UNUSED (conn); + if (! psecret || id != SASL_CB_PASS) return SASL_BADPARAM; diff --git a/uip/sendsbr.c b/uip/sendsbr.c index d866ebc..3eff75d 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -502,10 +502,12 @@ make_mime_composition_file_entry(char *file_name, int attachformat) } else { /* Suppress Content-Id, insert simple Content-Disposition and Content-Description with filename. */ + p = strrchr(file_name, '/'); (void) fprintf (composition_file, - "#%1$s; name=\"%2$s\" <> [%2$s]{attachment}", + "#%s; name=\"%s\" <> [%s]{attachment}", content_type, - ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1); + (p == (char *)0) ? file_name : p + 1, + (p == (char *)0) ? file_name : p + 1); } break; @@ -519,10 +521,12 @@ make_mime_composition_file_entry(char *file_name, int attachformat) } else { /* Suppress Content-Id, insert Content-Disposition with modification date and Content-Description wtih filename. */ + p = strrchr(file_name, '/'); (void) fprintf (composition_file, - "#%1$s; name=\"%2$s\" <>[%2$s]{attachment; modification-date=\"%3$s\"}", + "#%s; name=\"%s\" <>[%s]{attachment; modification-date=\"%s\"}", content_type, - ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1, + (p == (char *)0) ? file_name : p + 1, + (p == (char *)0) ? file_name : p + 1, dtime (&st.st_mtime, 0)); }