OSSP CVS Repository

ossp - Check-in [5010]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5010
Date: 2005-Feb-03 10:48:52 (local)
2005-Feb-03 09:48:52 (UTC)
User:rse
Branch:
Comment: Synchronize l2_ut_format.[ch] with OSSP cfg and especially now use va_copy for va_list copying for better portability.
Tickets:
Inspections:
Files:
ossp-pkg/l2/ChangeLog      1.25 -> 1.26     4 inserted, 0 deleted
ossp-pkg/l2/l2_ut_format.c      1.11 -> 1.12     8 inserted, 9 deleted

ossp-pkg/l2/ChangeLog 1.25 -> 1.26

--- ChangeLog    2005/02/03 09:46:58     1.25
+++ ChangeLog    2005/02/03 09:48:52     1.26
@@ -11,6 +11,10 @@
 
   Changes between 0.9.9 and 0.9.10 (01-Feb-2005 to 03-Feb-2005)
 
+    *) Synchronize l2_ut_format.[ch] with OSSP cfg and especially
+       now use va_copy for va_list copying for better portability.
+       [Ralf S. Engelschall <rse@engelschall.com>]
+
     *) Resolve trunc symbol conflict; make sure configure checks for
        isnan and isinf and l2_ut_format picks up the results'
        [Thomas Lotterer <thomas@lotterer.net>]


ossp-pkg/l2/l2_ut_format.c 1.11 -> 1.12

--- 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;

CVSTrac 2.0.1