| 1 |
Use stdarg.h instead of varargs.h. |
| 2 |
|
| 3 |
Bug-Debian: http://bugs.debian.org/195439 |
| 4 |
|
| 5 |
--- a/ifcico/respfreq.c |
| 6 |
+++ b/ifcico/respfreq.c |
| 7 |
@@ -18,7 +18,7 @@ int re_exec(char*); |
| 8 |
#include "lutil.h" |
| 9 |
#include "config.h" |
| 10 |
#ifndef NOFREQREPORT |
| 11 |
-#include <varargs.h> |
| 12 |
+#include <stdarg.h> |
| 13 |
#include "ftnmsg.h" |
| 14 |
#endif |
| 15 |
#include "version.h" |
| 16 |
@@ -44,7 +44,7 @@ static file_list *resplist(char*); |
| 17 |
|
| 18 |
#ifndef NOFREQREPORT |
| 19 |
static void attach_report(file_list**); |
| 20 |
-static void add_report(); |
| 21 |
+static void add_report(char*,...); |
| 22 |
static char *report_text=NULL; |
| 23 |
static unsigned long report_total=0L; |
| 24 |
#endif |
| 25 |
@@ -612,15 +612,12 @@ file_list **fl; |
| 26 |
report_text=NULL; |
| 27 |
} |
| 28 |
|
| 29 |
-static void add_report(va_alist) |
| 30 |
-va_dcl |
| 31 |
+static void add_report(char *fmt, ...) |
| 32 |
{ |
| 33 |
va_list args; |
| 34 |
- char *fmt; |
| 35 |
char buf[1024]; |
| 36 |
|
| 37 |
- va_start(args); |
| 38 |
- fmt=va_arg(args,char*); |
| 39 |
+ va_start(args,fmt); |
| 40 |
|
| 41 |
if (report_text == NULL) |
| 42 |
{ |
| 43 |
@@ -641,6 +638,7 @@ va_dcl |
| 44 |
vsprintf(buf,fmt,args); |
| 45 |
strcat(buf,"\r\n"); |
| 46 |
report_text=xstrcat(report_text,buf); |
| 47 |
+ va_end(args); |
| 48 |
} |
| 49 |
|
| 50 |
#endif |
| 51 |
--- a/iflib/lutil.c |
| 52 |
+++ b/iflib/lutil.c |
| 53 |
@@ -4,7 +4,7 @@ |
| 54 |
#include <stdio.h> |
| 55 |
#include <sys/stat.h> |
| 56 |
#include <string.h> |
| 57 |
-#include <varargs.h> |
| 58 |
+#include <stdarg.h> |
| 59 |
#include <errno.h> |
| 60 |
#include <time.h> |
| 61 |
#ifdef HAS_SYSLOG |
| 62 |
@@ -13,6 +13,8 @@ |
| 63 |
#define LOG_USER 0 |
| 64 |
#endif |
| 65 |
|
| 66 |
+#include "xutil.h" |
| 67 |
+ |
| 68 |
#ifdef HAS_SYSLOG |
| 69 |
static int syslog_opened=0; |
| 70 |
#else |
| 71 |
@@ -143,20 +145,20 @@ char c; |
| 72 |
syslog(level,"\terrno=%d : %s",\ |
| 73 |
errno,strerror(errno)); |
| 74 |
|
| 75 |
-void loginf(va_alist) |
| 76 |
-va_dcl |
| 77 |
+void loginf(char *fmt,...) |
| 78 |
{ |
| 79 |
va_list args; |
| 80 |
- char *fmt; |
| 81 |
#ifndef HAS_SYSLOG |
| 82 |
int oldmask; |
| 83 |
#endif |
| 84 |
|
| 85 |
- va_start(args); |
| 86 |
- fmt=va_arg(args, char*); |
| 87 |
+ va_start(args,fmt); |
| 88 |
if (verbose) |
| 89 |
{ |
| 90 |
- PRINT_DEBUG(fmt,args); |
| 91 |
+ va_list args2; |
| 92 |
+ va_copy(args2, args); |
| 93 |
+ PRINT_DEBUG(fmt,args2); |
| 94 |
+ va_end(args2); |
| 95 |
} |
| 96 |
#ifdef HAS_SYSLOG |
| 97 |
if (!syslog_opened) |
| 98 |
@@ -183,20 +185,20 @@ va_dcl |
| 99 |
return; |
| 100 |
} |
| 101 |
|
| 102 |
-void logerr(va_alist) |
| 103 |
-va_dcl |
| 104 |
+void logerr(char *fmt,...) |
| 105 |
{ |
| 106 |
va_list args; |
| 107 |
- char *fmt; |
| 108 |
#ifndef HAS_SYSLOG |
| 109 |
int oldmask; |
| 110 |
#endif |
| 111 |
|
| 112 |
- va_start(args); |
| 113 |
- fmt=va_arg(args, char*); |
| 114 |
+ va_start(args,fmt); |
| 115 |
if (verbose) |
| 116 |
{ |
| 117 |
- PRINT_DEBUG(fmt,args); |
| 118 |
+ va_list args2; |
| 119 |
+ va_copy(args2, args); |
| 120 |
+ PRINT_DEBUG(fmt,args2); |
| 121 |
+ va_end(args2); |
| 122 |
} |
| 123 |
#ifdef HAS_SYSLOG |
| 124 |
if (!syslog_opened) |
| 125 |
@@ -223,16 +225,11 @@ va_dcl |
| 126 |
return; |
| 127 |
} |
| 128 |
|
| 129 |
-void debug(va_alist) |
| 130 |
-va_dcl |
| 131 |
+void debug(unsigned long level, char *fmt,...) |
| 132 |
{ |
| 133 |
va_list args; |
| 134 |
- unsigned long level; |
| 135 |
- char *fmt; |
| 136 |
|
| 137 |
- va_start(args); |
| 138 |
- level=va_arg(args, unsigned long); |
| 139 |
- fmt=va_arg(args, char*); |
| 140 |
+ va_start(args,fmt); |
| 141 |
|
| 142 |
if ((verbose && (level == 0)) || (verbose & (1 << (level-1)))) |
| 143 |
{ |