aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2003-10-13 20:01:34 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2003-10-13 20:01:34 +0000
commita9d759415a0958e65a032961a97ecde743134696 (patch)
treeb38294e9d0d9d76b6aae1e9a2c3692a993d8d3d9 /sysutils
parenta6302cc460d0e47d5368a8e7c6caa3c432622775 (diff)
downloadports-a9d759415a0958e65a032961a97ecde743134696.tar.gz
ports-a9d759415a0958e65a032961a97ecde743134696.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/tcplist/files/patch-utils.c126
-rw-r--r--sysutils/tcplist/files/patch-utils.h26
2 files changed, 148 insertions, 4 deletions
diff --git a/sysutils/tcplist/files/patch-utils.c b/sysutils/tcplist/files/patch-utils.c
index 38e9a609b1c4..06333df6429a 100644
--- a/sysutils/tcplist/files/patch-utils.c
+++ b/sysutils/tcplist/files/patch-utils.c
@@ -1,6 +1,125 @@
---- utils.c.old Tue Feb 12 15:21:57 2002
-+++ utils.c Tue Feb 12 15:21:24 2002
-@@ -259,6 +259,7 @@
+--- utils.c.orig Mon Oct 13 13:14:12 2003
++++ utils.c Mon Oct 13 13:14:58 2003
+@@ -17,14 +17,9 @@
+ #else
+ #include <strings.h>
+ #endif
+-#include <varargs.h>
++#include <stdarg.h>
+ #include "utils.h"
+
+-#ifdef lint
+-#undef va_arg
+-#define va_arg(x,y) (y)NULL
+-#endif
+-
+ #ifndef u_long
+ #define u_long unsigned long
+ #endif /* u_long */
+@@ -42,14 +37,11 @@
+ * follows it.
+ */
+ /*VARARGS*/
+-void Error(va_alist)
+-va_dcl
++void Error(char *format, ...)
+ {
+ va_list args;
+- char *format;
+
+- va_start(args);
+- format = va_arg(args, char *);
++ va_start(args, format);
+ (void)fprintf(stderr, "%s: ", progname);
+ (void)vfprintf(stderr, format, args);
+ (void)fprintf(stderr, "\n");
+@@ -63,18 +55,11 @@
+ * is equal to or greater than the debugging level.
+ */
+ /*VARARGS*/
+-void dfprintf(va_alist)
+-va_dcl
++void dfprintf(int debugLevel, FILE *stream, char *format, ...)
+ {
+ va_list args;
+- int debugLevel;
+- FILE *stream;
+- char *format;
+
+- va_start(args);
+- debugLevel = va_arg(args, int);
+- stream = va_arg(args, FILE *);
+- format = va_arg(args, char *);
++ va_start(args, format);
+ if(d >= debugLevel){
+ (void)vfprintf(stream, format, args);
+ }
+@@ -85,18 +70,15 @@
+ * Warning(): behaves like Error, except returns rather than exits.
+ */
+ /*VARARGS*/
+-void Warning(va_alist)
+-va_dcl
++void Warning(char *format, ...)
+ {
+ va_list args;
+- char *format;
+
+- va_start(args);
+- format = va_arg(args, char *);
+- (void)fprintf(stderr, "%s: ", progname);
+- (void)vfprintf(stderr, format, args);
+- (void)fprintf(stderr, "\n");
+- va_end(args);
++ va_start(args, format);
++ (void)fprintf(stderr, "%s: ", progname);
++ (void)vfprintf(stderr, format, args);
++ (void)fprintf(stderr, "\n");
++ va_end(args);
+ }
+
+ FILE *efopen(file, mode)
+@@ -186,15 +168,14 @@
+ * in malloc'ed space.
+ */
+ /*VARARGS*/
+-char *cat(va_alist)
+-va_dcl
++char *cat(char *str0, ...)
+ {
+ va_list args;
+- unsigned length=1;
++ unsigned length=1+strlen(str0);
+ char *str, *newstr;
+
+ /* get length */
+- va_start(args);
++ va_start(args, str0);
+ loop{
+ str = va_arg(args, char *);
+ if(NULL!=str){
+@@ -209,9 +190,10 @@
+ if(NULL==newstr) Error("Out of memory in cat()");
+
+ newstr[0]=(char)0;
++ strcat(newstr, str0);
+
+ /* create string */
+- va_start(args);
++ va_start(args, str0);
+ loop{
+ str = va_arg(args, char *);
+ if(NULL!=str) {
+@@ -220,7 +202,7 @@
+ break;
+ }
+ }
+- va_end(args);
++ va_end(args);
+ #ifdef lint
+ args=args; /* make lint shut up about "args set but not used" */
+ #endif
+@@ -259,6 +241,7 @@
lastfail++;
}
}
@@ -8,4 +127,3 @@
sprintf(iaddrbuff, "%u.%u.%u.%u", (iaddr>>24)&0xff,
(iaddr>>16)&0xff, (iaddr>>8)&0xff,
iaddr&0xff);
-
diff --git a/sysutils/tcplist/files/patch-utils.h b/sysutils/tcplist/files/patch-utils.h
new file mode 100644
index 000000000000..5be668064827
--- /dev/null
+++ b/sysutils/tcplist/files/patch-utils.h
@@ -0,0 +1,26 @@
+--- utils.h.orig Mon Oct 13 13:14:12 2003
++++ utils.h Mon Oct 13 13:15:00 2003
+@@ -50,19 +50,19 @@
+
+ /* Error - print like fprintf(stderr, ...) and die. Progname included at
+ beginning of message, newline at end. */
+-extern void Error();
++extern void Error(char *, ...);
+ /* Warning - like error, without dying */
+-extern void Warning();
++extern void Warning(char *, ...);
+
+ extern char *mylib_malloc();
+ extern char *mylib_realloc();
+ extern char *mylib_scopy();
+ extern char *mylib_srcopy();
+-extern char *cat();
++extern char *cat(char *, ...);
+ extern char *getstr();
+ extern FILE *efopen();
+ extern void efclose();
+-extern void dfprintf();
++extern void dfprintf(int, FILE *, char *, ...);
+
+ extern char *progname; /* application's name. Used by Error, Warning. */
+ extern int d; /* debug level */