diff options
-rw-r--r-- | innbbsd/Makefile | 7 | ||||
-rw-r--r-- | innbbsd/bbslib.c | 30 | ||||
-rw-r--r-- | innbbsd/bbslib.h | 2 | ||||
-rw-r--r-- | innbbsd/bbslink.c | 11 | ||||
-rw-r--r-- | innbbsd/bbslink2.c | 1 | ||||
-rw-r--r-- | innbbsd/echobbslib.c | 30 | ||||
-rw-r--r-- | innbbsd/file.c | 34 | ||||
-rw-r--r-- | innbbsd/inntobbs.c | 4 |
8 files changed, 56 insertions, 63 deletions
diff --git a/innbbsd/Makefile b/innbbsd/Makefile index 38e9a2db..8fd415ad 100644 --- a/innbbsd/Makefile +++ b/innbbsd/Makefile @@ -5,13 +5,14 @@ # create : 95/03/29 # # update : 95/12/15 # # ------------------------------------------------------- # +# stdarg.h patch for pttbbs by in2 03/05/05 # #################################################### # this is a bbs <--> news gateway ##################################################### -VERSION=0.50beta-4 -LASTVERSION=0.50beta-3 -ADMINUSER= root@your.domain.name +VERSION=0.51 +LASTVERSION=0.50beta-4 +ADMINUSER?= root@your.domain.name BBSHOME?=$(HOME) BBS_SRC = .. TARGET = $(INNBBSD) $(BBSNNRP) $(BBSLINK) diff --git a/innbbsd/bbslib.c b/innbbsd/bbslib.c index 0dc808c3..c0177e87 100644 --- a/innbbsd/bbslib.c +++ b/innbbsd/bbslib.c @@ -1,9 +1,9 @@ #if defined( LINUX ) # include "innbbsconf.h" # include "bbslib.h" -# include <varargs.h> +# include <stdarg.h> #else -# include <varargs.h> +# include <stdarg.h> # include "innbbsconf.h" # include "bbslib.h" #endif @@ -76,17 +76,15 @@ setverboseoff() } } -verboselog(va_alist) -va_dcl +verboselog(char *fmt, ...) { va_list ap; - register char* fmt; char datebuf[40]; time_t now; if (verboseFlag == 0) return; - va_start(ap); + va_start(ap, fmt); time(&now); strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now)); @@ -97,8 +95,10 @@ va_dcl else bbslogfp = fdopen(1, "a"); } - if (bbslogfp == NULL) { va_end(ap); return; } - fmt = va_arg(ap, char *) ; + if (bbslogfp == NULL) { + va_end(ap); + return; + } fprintf(bbslogfp,"%s[%d] ",datebuf, getpid()); vfprintf(bbslogfp, fmt, ap); fflush(bbslogfp); @@ -106,18 +106,16 @@ va_dcl } #ifdef PalmBBS -xbbslog(va_alist) +xbbslog(char *fmt, ...) #else -bbslog(va_alist) +bbslog(char *fmt, ...) #endif -va_dcl { va_list ap; - register char* fmt; char datebuf[40]; time_t now; - va_start(ap); + va_start(ap, fmt); time(&now); strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now)); @@ -125,8 +123,10 @@ va_dcl if (bbslogfp == NULL) { bbslogfp = fopen(LOGFILE, "a"); } - if (bbslogfp == NULL) { va_end(ap); return; } - fmt = va_arg(ap, char *) ; + if (bbslogfp == NULL) { + va_end(ap); + return; + } fprintf(bbslogfp,"%s[%d] ",datebuf,getpid()); vfprintf(bbslogfp, fmt, ap); fflush(bbslogfp); diff --git a/innbbsd/bbslib.h b/innbbsd/bbslib.h index 190672b7..a03a1d67 100644 --- a/innbbsd/bbslib.h +++ b/innbbsd/bbslib.h @@ -51,7 +51,7 @@ int initial_bbs ARG((char* )); char *restrdup ARG((char *, char *)); nodelist_t *search_nodelist ARG((char *, char *)); newsfeeds_t *search_group ARG((char *)); -int bbslog ARG(()); +int bbslog(char *fmt, ...); void *mymalloc ARG((int)); void *myrealloc ARG((void *, int)); diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c index 300f3f7d..1c0b1565 100644 --- a/innbbsd/bbslink.c +++ b/innbbsd/bbslink.c @@ -1,9 +1,9 @@ #if defined( LINUX ) # include "innbbsconf.h" # include "bbslib.h" -# include <varargs.h> +# include <stdarg.h> #else -# include <varargs.h> +# include <stdarg.h> # include "innbbsconf.h" # include "bbslib.h" #endif @@ -248,15 +248,12 @@ bbslink_get_lock(file) int -tcpcommand(va_alist) -va_dcl +tcpcommand(char *fmt, ...) { va_list ap; - register char *fmt; char *ptr; - va_start(ap); - fmt = va_arg(ap, char *); + va_start(ap, fmt); vfprintf(NNTPwfp, fmt, ap); fprintf(NNTPwfp, "\r\n"); fflush(NNTPwfp); diff --git a/innbbsd/bbslink2.c b/innbbsd/bbslink2.c index 70d39766..7a6834b3 100644 --- a/innbbsd/bbslink2.c +++ b/innbbsd/bbslink2.c @@ -223,7 +223,6 @@ va_dcl char *ptr; va_start(ap); - fmt = va_arg(ap, char *); vfprintf(NNTPwfp, fmt, ap); fprintf(NNTPwfp, "\r\n"); fflush(NNTPwfp); diff --git a/innbbsd/echobbslib.c b/innbbsd/echobbslib.c index 84d77de6..2511b50a 100644 --- a/innbbsd/echobbslib.c +++ b/innbbsd/echobbslib.c @@ -1,9 +1,9 @@ #if defined( LINUX ) # include "innbbsconf.h" # include "bbslib.h" -# include <varargs.h> +# include <stdarg.h> #else -# include <varargs.h> +# include <stdarg.h> # include "innbbsconf.h" # include "bbslib.h" #endif @@ -76,17 +76,15 @@ setverboseoff() } } -verboselog(va_alist) -va_dcl +verboselog(char *fmt, ...) { va_list ap; - register char* fmt; char datebuf[40]; time_t now; if (verboseFlag == 0) return; - va_start(ap); + va_start(ap, fmt); time(&now); strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now)); @@ -97,8 +95,10 @@ va_dcl else bbslogfp = fdopen(1, "a"); } - if (bbslogfp == NULL) { va_end(ap); return; } - fmt = va_arg(ap, char *) ; + if (bbslogfp == NULL) { + va_end(ap); + return; + } fprintf(bbslogfp,"%s[%d] ",datebuf, getpid()); vfprintf(bbslogfp, fmt, ap); fflush(bbslogfp); @@ -106,18 +106,16 @@ va_dcl } #ifdef PalmBBS -xbbslog(va_alist) +xbbslog(char *fmt, ...) #else -bbslog(va_alist) +bbslog(char *fmt, ...) #endif -va_dcl { va_list ap; - register char* fmt; char datebuf[40]; time_t now; - va_start(ap); + va_start(ap, fmt); time(&now); strftime(datebuf, sizeof(datebuf), "%b %d %X ", localtime(&now)); @@ -125,8 +123,10 @@ va_dcl if (bbslogfp == NULL) { bbslogfp = fopen(LOGFILE, "a"); } - if (bbslogfp == NULL) { va_end(ap); return; } - fmt = va_arg(ap, char *) ; + if (bbslogfp == NULL) { + va_end(ap); + return; + } fprintf(bbslogfp,"%s[%d] ",datebuf,getpid()); vfprintf(bbslogfp, fmt, ap); fflush(bbslogfp); diff --git a/innbbsd/file.c b/innbbsd/file.c index d4df15b2..7016f940 100644 --- a/innbbsd/file.c +++ b/innbbsd/file.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> -#include <varargs.h> +#include <stdarg.h> #define MAXARGS 100 /* isfile is called by @@ -25,20 +25,14 @@ FILE *fp; fileglue("%s/%s",home,".newsrc"); */ -char *fileglue(va_alist) -va_dcl +char *fileglue(char *fmt, ...) { - va_list ap; - register char* fmt; - static char *newstring; - static char gluebuffer[8192]; - - va_start(ap); - fmt = va_arg(ap, char *) ; - vsprintf(gluebuffer, fmt, ap); - newstring = gluebuffer; - va_end(ap); - return newstring; + va_list ap; + static char gluebuffer[8192]; + va_start(ap, fmt); + vsprintf(gluebuffer, fmt, ap); + va_end(ap); + return gluebuffer; } long @@ -71,8 +65,8 @@ char* filename; return 1; } +#ifdef TEST int isfilev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -88,6 +82,7 @@ va_dcl va_end(ap); return isfile(FILEBUF); } +#endif int isdir(filename) @@ -100,8 +95,8 @@ char* filename; return 1; } +#ifdef TEST int isdirv(va_alist) -va_dcl { va_list ap; struct stat st; @@ -116,6 +111,7 @@ va_dcl va_end(ap); return isdir(FILEBUF); } +#endif unsigned long mtime(filename) char* filename; @@ -125,8 +121,8 @@ char* filename; return st.st_mtime; } +#ifdef TEST unsigned long mtimev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -141,6 +137,7 @@ va_dcl va_end(ap); return mtime(FILEBUF); } +#endif unsigned long atime(filename) char *filename; @@ -150,8 +147,8 @@ char *filename; return st.st_atime; } +#ifdef TEST unsigned long atimev(va_alist) -va_dcl { va_list ap; struct stat st; @@ -166,6 +163,7 @@ va_dcl va_end(ap); return atime(FILEBUF); } +#endif /*#undef TEST*/ #ifdef TEST diff --git a/innbbsd/inntobbs.c b/innbbsd/inntobbs.c index b57d8bb1..653ea488 100644 --- a/innbbsd/inntobbs.c +++ b/innbbsd/inntobbs.c @@ -18,9 +18,7 @@ ORGANIZATION_H, LASTHEADER, }; */ -char *strchr ARG((char*,int)); -char *strrchr ARG((char*,int)); -char *strstr ARG((char*,char*)); +#include <string.h> header_t headertable[] = { "Subject" ,SUBJECT_H, |