/* * util.c: Generic utility functions for p4filter * $Header$ */ #include <config.h> #include "netjunk.h" #include "util.h" #include <stdarg.h> #include <stdio.h> /* This is a global. */ int verbose; void errmsg(const char *msg, ...) { char buf[1025]; va_list ap; /* Do nothing if not verbose. */ if (!verbose) return; /* Otherwise, start pretending to be printf(). */ va_start(ap, msg); #ifdef HAVE_VSNPRINTF vsnprintf(buf, 1024, msg, ap); #else vsprintf(buf, msg, ap); /* Potential buffer overflow */ #endif dowrite(2, buf, strlen(buf)); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 450 | sandy_currier |
Initial import of p4filter code. This contains a solaris2.6 binary but no others. |