openbsd-ports/mbone/imm/patches/patch-src_utils_c
2004-01-05 00:02:31 +00:00

94 lines
2.3 KiB
Plaintext

$OpenBSD: patch-src_utils_c,v 1.1 2004/01/05 00:02:31 espie Exp $
--- src/utils.c.orig 2004-01-05 00:57:33.000000000 +0100
+++ src/utils.c 2004-01-05 00:59:45.000000000 +0100
@@ -20,12 +20,10 @@
* These notices must be retained in any copies of any part of this software.
******************************************************************************/
#include <stdio.h>
-#include <varargs.h>
+#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#ifdef __NetBSD__
#include <unistd.h>
-#endif
extern int debug;
extern int seed;
@@ -40,14 +38,11 @@ int err_block_size=100; /* default for 1
/*----------------------------------------------------------------------------*/
-void warn( va_alist )
-va_dcl
+void warn(const char *fmt, ...)
{
va_list args;
- char *fmt;
- va_start( args );
- fmt = va_arg( args, char * );
+ va_start( args, fmt );
fprintf( stderr, "Warning: " );
vfprintf( stderr, fmt, args );
va_end( args );
@@ -55,31 +50,27 @@ va_dcl
/*----------------------------------------------------------------------------*/
-void die( va_alist )
-va_dcl
+void die(const char *fmt, ...)
{
va_list args;
- char *fmt;
- va_start( args );
- fmt = va_arg( args, char * );
+ va_start( args, fmt );
fprintf( stderr, "Error: " );
vfprintf( stderr, fmt, args );
+ va_end(args);
exit( 1 );
}
/*----------------------------------------------------------------------------*/
-void fatal( va_alist )
-va_dcl
+void fatal(const char *fmt, ...)
{
va_list args;
- char *fmt;
- va_start( args );
- fmt = va_arg( args, char * );
+ va_start( args, fmt );
fprintf( stderr, "Internal Error: " );
vfprintf( stderr, fmt, args );
+ va_end(args);
exit( 2 );
}
@@ -142,18 +133,15 @@ char * filename;
/*----------------------------------------------------------------------------*/
-void mailmessage( va_alist )
-va_dcl
+void mailmessage(const char *fmt, ...)
{
va_list args;
- char *fmt;
FILE *popen(), *fp;
char cmdline[80];
if (whome == NULL) whome = getlogin();
sprintf(cmdline,"%s %s",mailprog,whome);
fp = popen(cmdline,"w");
- va_start( args );
- fmt = va_arg( args, char * );
+ va_start( args, fmt );
fprintf( fp, "MNM Warning: " );
vfprintf( fp, fmt, args );
va_end( args );