--- l2_ut_format.c 2005/02/03 09:45:37 1.11
+++ l2_ut_format.c 2005/02/03 09:48:52 1.12
@@ -1,8 +1,8 @@
/*
** OSSP l2 - Flexible Logging
-** Copyright (c) 2001-2004 Cable & Wireless <http://www.cw.com/>
-** Copyright (c) 2001-2004 The OSSP Project <http://www.ossp.org/>
-** Copyright (c) 2001-2004 Ralf S. Engelschall <rse@engelschall.com>
+** Copyright (c) 2001-2005 Cable & Wireless <http://www.cw.com/>
+** Copyright (c) 2001-2005 The OSSP Project <http://www.ossp.org/>
+** Copyright (c) 2001-2005 Ralf S. Engelschall <rse@engelschall.com>
**
** This file is part of OSSP l2, a flexible logging library which
** can be found at http://www.ossp.org/pkg/lib/l2/.
@@ -40,7 +40,7 @@
* Especially any Apache and network specific kludges were removed again
* and instead the formatting engine now can be extended by the caller
* on-the-fly. It was then finally adjusted to be stand-alone for use
- * inside OSSP l2.
+ * inside OSSP.
*/
/*
@@ -96,7 +96,6 @@
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
-#include <math.h>
#include "l2_config.h"
#include "l2_ut_format.h"
@@ -379,7 +378,7 @@
#define PAD(width, len, ch) \
do { \
INS_CHAR(ch, sp, bep, cc); \
- width-- ; \
+ width--; \
} while (width > len)
/*
@@ -645,7 +644,7 @@
register char *sp;
register char *bep;
register int cc = 0;
- register int i;
+ register unsigned int i;
char *s = NULL;
char *q;
@@ -1153,12 +1152,12 @@
char *s;
int rv;
- apbak = ap;
+ va_copy(apbak, ap);
if ((rv = l2_util_vsprintf(NULL, -1, fmt, ap)) == -1)
return NULL;
if ((s = malloc(rv+1)) == NULL)
return NULL;
- ap = apbak;
+ va_copy(ap, apbak);
if ((rv = l2_util_vsprintf(s, rv+1, fmt, ap)) == -1) {
free(s);
return NULL;
|