* novm - log an error message saying we ran out of memory, and die.
*/
void
-novm(char *msg)
+novm(const char *msg)
{
fatal("Virtual memory exhausted allocating %s\n", msg);
}
static FILE *debugFile;
void
-fatal(char *fmt, ...)
+fatal(const char *fmt, ...)
{
va_list pvar;
va_start(pvar, fmt);
}
void
-error(char *fmt, ...)
+error(const char *fmt, ...)
{
va_list pvar;
va_start(pvar, fmt);
}
void
-warn(char *fmt, ...)
+warn(const char *fmt, ...)
{
va_list pvar;
va_start(pvar, fmt);
}
void
-info(char *fmt, ...)
+info(const char *fmt, ...)
{
va_list pvar;
va_start(pvar, fmt);
bool debug_on();
/* Safe sprintf++ */
-int slprintf(char *, int, char *, ...);
+int slprintf(char *, int, const char *, ...);
/* vsprintf++ */
-int vslprintf(char *, int, char *, va_list);
+int vslprintf(char *, int, const char *, va_list);
/* safe strcpy */
size_t strlcpy(char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
/* log a debug message */
-void dbglog(char *, ...);
+void dbglog(const char *, ...);
/* log an informational message */
-void info(char *, ...);
+void info(const char *, ...);
/* log a notice-level message */
-void notice(char *, ...);
+void notice(const char *, ...);
/* log a warning message */
-void warn(char *, ...);
+void warn(const char *, ...);
/* log an error message */
-void error(char *, ...);
+void error(const char *, ...);
/* log an error message and die(1) */
-void fatal(char *, ...);
+void fatal(const char *, ...);
/* Say we ran out of memory, and die */
-void novm(char *);
+void novm(const char *);
/* Format a packet and log it with syslog */
void log_packet(unsigned char *, int, char *, int);
extern char *strerror();
#endif
-static void logit(int, char *, va_list);
+static void logit(int, const char *, va_list);
static void log_write(int, char *);
static void vslp_printer(void *, char *, ...);
static void format_packet(u_char *, int, printer_func, void *);
* Returns the number of chars put into buf.
*/
int
-slprintf(char *buf, int buflen, char *fmt, ...)
+slprintf(char *buf, int buflen, const char *fmt, ...)
{
va_list args;
int n;
#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0)
int
-vslprintf(char *buf, int buflen, char *fmt, va_list args)
+vslprintf(char *buf, int buflen, const char *fmt, va_list args)
{
int c, i, n;
int width, prec, fillch;
int base, len, neg, quoted;
long lval = 0;
unsigned long val = 0;
- char *str, *f, *buf0;
+ char *str, *buf0;
+ const char *f;
unsigned char *p;
char num[32];
time_t t;
* logit - does the hard work for fatal et al.
*/
static void
-logit(int level, char *fmt, va_list args)
+logit(int level, const char *fmt, va_list args)
{
char buf[1024];
* fatal - log an error message and die horribly.
*/
void
-fatal(char *fmt, ...)
+fatal(const char *fmt, ...)
{
va_list pvar;
* error - log an error message.
*/
void
-error(char *fmt, ...)
+error(const char *fmt, ...)
{
va_list pvar;
* warn - log a warning message.
*/
void
-warn(char *fmt, ...)
+warn(const char *fmt, ...)
{
va_list pvar;
* notice - log a notice-level message.
*/
void
-notice(char *fmt, ...)
+notice(const char *fmt, ...)
{
va_list pvar;
* info - log an informational message.
*/
void
-info(char *fmt, ...)
+info(const char *fmt, ...)
{
va_list pvar;
* dbglog - log a debug message.
*/
void
-dbglog(char *fmt, ...)
+dbglog(const char *fmt, ...)
{
va_list pvar;