X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=errlog.c;h=e4e9ef8c10ba58cac5dae2a20d83887fcc7c1648;hb=13a73d1e48b9f0c0c250cc2efc11ab0d469e55a0;hp=ae943f6ff6bf38c5e0da953fc56cbc70dea56fb9;hpb=c78f4a30b2b5cde78c3eabd17358c2b2c86a6df6;p=privoxy.git diff --git a/errlog.c b/errlog.c index ae943f6f..e4e9ef8c 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.87 2009/03/01 18:28:24 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.89 2009/03/07 12:56:12 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -33,6 +33,12 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.87 2009/03/01 18:28:24 fabiankeil E * * Revisions : * $Log: errlog.c,v $ + * Revision 1.89 2009/03/07 12:56:12 fabiankeil + * Add log_error() support for unsigned long long (%lld). + * + * Revision 1.88 2009/03/07 11:34:36 fabiankeil + * Omit timestamp and thread id in the mingw32 message box. + * * Revision 1.87 2009/03/01 18:28:24 fabiankeil * Help clang understand that we aren't dereferencing * NULL pointers here. @@ -472,7 +478,7 @@ const char errlog_h_rcs[] = ERRLOG_H_VERSION; static FILE *logfp = NULL; /* logging detail level. XXX: stupid name. */ -static int debug = (LOG_LEVEL_FATAL | LOG_LEVEL_ERROR | LOG_LEVEL_INFO); +static int debug = (LOG_LEVEL_FATAL | LOG_LEVEL_ERROR); /* static functions */ static void fatal_error(const char * error_message); @@ -1129,7 +1135,7 @@ void log_error(int loglevel, const char *fmt, ...) snprintf(tempbuf, sizeof(tempbuf), "%u", uval); break; case 'l': - /* this is a modifier that must be followed by u or d */ + /* this is a modifier that must be followed by u, lu, or d */ ch = *src++; if (ch == 'd') { @@ -1141,6 +1147,12 @@ void log_error(int loglevel, const char *fmt, ...) ulval = va_arg( ap, unsigned long ); snprintf(tempbuf, sizeof(tempbuf), "%lu", ulval); } + else if ((ch == 'l') && (*src == 'u')) + { + unsigned long long lluval = va_arg(ap, unsigned long long); + snprintf(tempbuf, sizeof(tempbuf), "%llu", lluval); + ch = *src++; + } else { snprintf(tempbuf, sizeof(tempbuf), "Bad format string: \"%s\"", fmt);