Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
vrfy
vrfy_990522-varargs.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vrfy_990522-varargs.diff of Package vrfy
--- defs.h +++ defs.h @@ -4,6 +4,8 @@ ** @(#)defs.h e07@nikhef.nl (Eric Wassenaar) 971114 */ +#include <stdarg.h> + /* ** Internal declarations of the vrfy utility ** ----------------------------------------- @@ -17,6 +19,7 @@ void error PROTO((char *, ...)); void usrerr PROTO((char *, ...)); void message PROTO((char *, ...)); +void vmessage PROTO((char *, va_list args)); void response PROTO((char *)); void show PROTO((int, char *)); void loop PROTO((char *, char *)); @@ -69,7 +72,7 @@ sigtype_t timer PROTO((int)); char *sfgets PROTO((char *, int, FILE *)); -int makeconnection PROTO((char *, char **, char **)); +int makeconnection PROTO((char *, FILE **, FILE **)); void setmyhostname PROTO((void)); int getmyhostname PROTO((char *)); bool internet PROTO((char *)); --- main.c +++ main.c @@ -589,13 +589,13 @@ */ void -/*VARARGS1*/ -fatal(fmt, a, b, c, d) -char *fmt; /* format of message */ -char *a, *b, *c, *d; /* optional arguments */ +fatal(char *fmt, ...) { - (void) fprintf(stderr, fmt, a, b, c, d); + va_list args; + va_start(args, fmt); + (void) vfprintf(stderr, fmt, args); (void) fprintf(stderr, "\n"); + va_end(args); exit(EX_USAGE); } @@ -608,13 +608,14 @@ ** None. */ -void /*VARARGS1*/ -error(fmt, a, b, c, d) -char *fmt; /* format of message */ -char *a, *b, *c, *d; /* optional arguments */ +void +error(char *fmt, ...) { - (void) fprintf(stderr, fmt, a, b, c, d); + va_list args; + va_start(args, fmt); + (void) vfprintf(stderr, fmt, args); (void) fprintf(stderr, "\n"); + va_end(args); } /* @@ -629,20 +630,20 @@ */ void -/*VARARGS1*/ -usrerr(fmt, a, b, c, d) -char *fmt; /* format of message */ -char *a, *b, *c, *d; /* optional arguments */ +usrerr(char *fmt, ...) { char msg[BUFSIZ]; /* status message buffer */ + va_list args; /* suppress message if requested */ if (SuprErrs) return; /* issue message with fatal error status */ - (void) sprintf(msg, "554 %s", fmt); - message(msg, a, b, c, d); + va_start(args, fmt); + sprintf(msg, "554 %s", fmt); + vmessage(msg, args); + va_end(args); } /* @@ -656,10 +657,7 @@ */ void -/*VARARGS1*/ -message(msg, a, b, c, d) -char *msg; /* status message */ -char *a, *b, *c, *d; /* optional arguments */ +vmessage(char *msg, va_list args) { char *fmt = &msg[4]; /* format of actual message */ @@ -676,10 +674,19 @@ printf("%s ... ", printable(AddrSpec)); /* print message itself */ - printf(fmt, a, b, c, d); + vprintf(fmt, args); printf("\n"); } + void + message(char *msg, ...) + { + va_list args; + va_start(args, msg); + vmessage(msg, args); + va_end(args); + } + /* ** RESPONSE -- Process reply message from smtp vrfy request ** -------------------------------------------------------- --- port.h +++ port.h @@ -159,12 +159,10 @@ ** No prototypes yet. */ -#define PROTO(TYPES) () - #if !defined(__STDC__) || defined(apollo) -#define Proto(TYPES) () +#define PROTO(TYPES) () #else -#define Proto(TYPES) TYPES +#define PROTO(TYPES) TYPES #endif #if !defined(__STDC__) || defined(apollo) --- smtp.c +++ smtp.c @@ -593,14 +593,14 @@ void /*VARARGS1*/ -smtpmessage(fmt, a, b, c, d) -char *fmt; /* format of message */ -char *a, *b, *c, *d; /* optional arguments */ +smtpmessage(char *fmt, ...) { + va_list args; + va_start(args, fmt); if (SmtpOut != NULL) { /* construct the output message */ - (void) sprintf(SmtpMsgBuffer, fmt, a, b, c, d); + vsprintf(SmtpMsgBuffer, fmt, args); /* display the output in verbose mode */ if (verbose >= 2 || debug) @@ -609,6 +609,7 @@ /* send the message over the channel */ (void) fprintf(SmtpOut, "%s%s", SmtpMsgBuffer, SmtpCrLf); } + va_end(args); } /* --- vrfy.h +++ vrfy.h @@ -11,6 +11,8 @@ #undef obsolete /* old code left as a reminder */ #undef notyet /* new code for possible future use */ +#define BUFSIZ 4096 /* pray it's safe... */ + #include <stdio.h> #include <ctype.h> #include <errno.h>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor