Skip to content
Snippets Groups Projects
Commit 520ea9b8 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

Parameters in front of va_alist are unportable; use va_arg instead.

parent 5d5370c3
No related branches found
No related tags found
No related merge requests found
......@@ -303,27 +303,32 @@ LDAPMessage *entry;
ldap_value_free( val );
}
printFormatted( lineLength, systemMessage, output, format, va_alist )
int lineLength, systemMessage;
FILE *output;
char *format;
printFormatted( va_alist )
va_dcl
{
int lineLength, systemMessage;
FILE *output;
char *format;
va_list ap;
char buffer[BUFSIZ];
char *head, *p, *q;
char *tag;
int count;
va_start( ap );
lineLength = va_arg( ap, int );
systemMessage = va_arg( ap, int );
output = va_arg( ap, FILE * );
format = va_arg( ap, char * );
if ( systemMessage ) {
lineLength--;
tag = "% ";
} else
tag = "";
va_start( ap );
vsprintf( buffer, format, ap );
va_end( ap );
if ( strlen( buffer ) < lineLength )
fprintf( output, "%s%s\r\n", tag, buffer );
else {
......
......@@ -34,8 +34,7 @@ void setproctitle
#if defined( HAVE_STDARG )
( const char *fmt, ... )
#else
( fmt, va_alist )
const char *fmt;
( va_alist )
va_dcl
#endif
{
......@@ -48,7 +47,10 @@ va_dcl
#if defined( HAVE_STDARG )
va_start(ap, fmt);
#else
const char *fmt;
va_start(ap);
fmt = va_arg(ap, const char *);
#endif
#ifdef HAVE_VSNPRINTF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment