And fix the errors that the compiler then detects.
*/
int netsec_printf(netsec_context *ns_context, char **errstr,
- const char *format, ...);
+ const char *format, ...) CHECK_PRINTF(3, 4);
/*
* Write bytes using a va_list argument.
*/
int netsec_vprintf(netsec_context *ns_context, char **errstr,
- const char *format, va_list ap);
+ const char *format, va_list ap) CHECK_PRINTF(3, 0);
/*
* Flush any buffered bytes to the network.
*
*/
-void netsec_err(char **errstr, const char *format, ...);
+void netsec_err(char **errstr, const char *format, ...)
+ CHECK_PRINTF(2, 3);
int build_form (char *, char *, int *, char *, char *, char *, char *,
char *, char *);
int sendsbr (char **, int, char *, char *, struct stat *, int, const char *);
-int SOprintf (char *, ...);
+int SOprintf (char *, ...) CHECK_PRINTF(1, 2);
int what_now (char *, int, int, char *, char *,
int, struct msgs *, char *, int, char *, int);
-int WhatNow(int, char **);
+int WhatNow(int, char **) NORETURN;
/* Includes trailing NUL */
const char *);
static int rclient (char *, char *, char **);
-static int sm_ierror (const char *fmt, ...);
+static int sm_ierror (const char *fmt, ...) CHECK_PRINTF(1, 2);
static int sm_nerror (char *);
-static int smtalk (int time, char *fmt, ...);
+static int smtalk (int time, char *fmt, ...) CHECK_PRINTF(2, 3);
static int sm_wstream (char *, int);
static int smhear (void);
static char *EHLOset (char *);
*/
if (count >= nsc->ns_inbufsize / 2) {
- netsec_err(errstr, "Unable to find a line terminator after %d bytes",
+ netsec_err(errstr, "Unable to find a line terminator after %zu bytes",
count);
return NULL;
}
static int write_content (CT, const char *, char *, FILE *, int, int);
static void set_text_ctparams(CT, char *, int);
static int remove_file (const char *);
-static void report (char *, char *, char *, char *, ...);
+static void report (char *, char *, char *, char *, ...)
+ CHECK_PRINTF(4, 5);
static void pipeser (int);
static void intrser (int);
static void pipeser (int);
static void quitser (int);
-static void mhladios (char *, char *, ...);
+static void mhladios (char *, char *, ...) CHECK_PRINTF(2, 3);
static void mhldone (int);
static void filterbody (struct mcomp *, char *, int, int,
m_getfld_state_t);
if ((ovtxt = c1->c_ovtxt ? c1->c_ovtxt : global.c_ovtxt) == NULL)
ovtxt = "";
if (wid < ovoff + strlen (ovtxt) + 5)
- mhladios (NULL, "component: %s width(%d) too small for overflow(%d)",
+ mhladios(NULL, "component: %s width(%d) too small for overflow(%zu)",
c1->c_name, wid, ovoff + strlen (ovtxt) + 5);
onelp = NULL;
int part_ok (CT);
int part_exact(CT ct);
int type_ok (CT, int);
-void content_error (char *, CT, char *, ...);
+void content_error (char *, CT, char *, ...) CHECK_PRINTF(3, 4);
void flush_errors (void);
* static prototypes
*/
-static int command(const char *, ...);
+static int command(const char *, ...) CHECK_PRINTF(1, 2);
static int multiline(void);
-static int traverse (int (*)(void *, char *), void *closure, const char *, ...);
-static int vcommand(const char *, va_list);
+static int traverse(int (*)(void *, char *), void *closure,
+ const char *, ...) CHECK_PRINTF(3, 4);
+static int vcommand(const char *, va_list) CHECK_PRINTF(1, 0);
static int pop_getline (char *, int, netsec_context *);
static int pop_sasl_callback(enum sasl_message_type, unsigned const char *,
unsigned int, unsigned char **, unsigned int *,
static void sigoff (void);
static void p_refile (char *);
static void fcc (char *, char *);
-static void die (char *, char *, ...);
+static void die (char *, char *, ...) CHECK_PRINTF(2, 3);
static void post (char *, int, int, int, char *, int, char *);
static void do_text (char *file, int fd);
static void do_an_address (struct mailname *, int);
static void alrmser (int);
static void get_sender (char *, char **);
static int copy_message (int, char *, int);
-static void verbose_printf (char *fmt, ...);
-static void adorn (char *, char *, ...);
-static void debug_printf (char *fmt, ...);
+static void verbose_printf (char *fmt, ...) CHECK_PRINTF(1, 2);
+static void adorn (char *, char *, ...) CHECK_PRINTF(2, 3);
+static void debug_printf (char *fmt, ...) CHECK_PRINTF(1, 2);
static int suppress_duplicates (int, char *);
static char *trim (char *);
p->p_value = getcpy (q ? q->p_value : "");
p->p_flags &= ~P_CHK;
if (debug)
- debug_printf ("vars[%d]: name=\"%s\" value=\"%s\"\n",
+ debug_printf ("vars[%ld]: name=\"%s\" value=\"%s\"\n",
p - vars, p->p_name, trim(p->p_value));
}
if (debug) {
for (p = hdrs; p->p_name; p++)
- debug_printf ("hdrs[%d]: name=\"%s\" value=\"%s\"\n",
+ debug_printf ("hdrs[%ld]: name=\"%s\" value=\"%s\"\n",
p - hdrs, p->p_name, p->p_value ? trim(p->p_value) : "");
}
if (debug) {
for (p = vars; p->p_name; p++)
- debug_printf ("vars[%d]: name=\"%s\" value=\"%s\"\n",
+ debug_printf ("vars[%ld]: name=\"%s\" value=\"%s\"\n",
p - vars, p->p_name, trim(p->p_value));
}
}