X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e67c4ce1edf3aa6f9e307aad254e46fd7f1652b6..5a79e16fadb052b22d5a1b9a5d4f0f7e05ee55b0:/util.c diff --git a/util.c b/util.c index 9571cbb5..558f2fbf 100644 --- a/util.c +++ b/util.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.66 2000-06-10 08:11:12 assar Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.69 2000-07-11 00:49:03 assar Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -38,16 +38,9 @@ static const char rcsid[] = #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_MALLOC_H -#include -#endif #include #include -#if __STDC__ #include -#else -#include -#endif #include #include #ifdef TIME_WITH_SYS_TIME @@ -226,23 +219,13 @@ tok2str(register const struct tok *lp, register const char *fmt, /* VARARGS */ -__dead void -#if __STDC__ +void error(const char *fmt, ...) -#else -error(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list ap; (void)fprintf(stderr, "%s: ", program_name); -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vfprintf(stderr, fmt, ap); va_end(ap); if (*fmt) { @@ -256,22 +239,12 @@ error(fmt, va_alist) /* VARARGS */ void -#if __STDC__ warning(const char *fmt, ...) -#else -warning(fmt, va_alist) - const char *fmt; - va_dcl -#endif { va_list ap; (void)fprintf(stderr, "%s: WARNING: ", program_name); -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)vfprintf(stderr, fmt, ap); va_end(ap); if (*fmt) { @@ -356,7 +329,7 @@ safeputchar(int c) ch = (unsigned char)(c & 0xff); if (c < 0x80 && isprint(c)) - printf("\\%03o", c & 0xff); - else printf("%c", c & 0xff); + else + printf("\\%03o", c & 0xff); }