On 7/4/06, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
Update of /cvsroot/naviserver/naviserver/nsd
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv9637/nsd

Modified Files:
        log.c
Log Message:
Rewritten to support any number of user-assigned callbacks.


Index: log.c
===================================================================
RCS file: /cvsroot/naviserver/naviserver/nsd/log.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** log.c       19 Feb 2006 14:23:40 -0000      1.13
--- log.c       4 Jul 2006 17:33:46 -0000       1.14
***************
*** 44,93 ****
   */

! #define LOG_ROLL     0x01
! #define LOG_EXPAND   0x02
! #define LOG_USEC     0x04

  /*
!  * The following struct maintains per-thread
!  * cached formatted time strings and log buffers.
   */
[...1538 lines suppressed...]
+  *      None.
+  *
+  *----------------------------------------------------------------------
+  */
+
+ static char*
+ SeverityName(Ns_LogSeverity severity)
+ {
+     char *severityStr, buf[10];
+
+     if (severity < (sizeof(logConfig) / sizeof(logConfig[0]))) {
+         severityStr = logConfig[severity].string;
+     } else {
+         severityStr = buf;
+         sprintf(buf, "Level%d", severity);
+     }
+
+     return severityStr;
+ }
+



This is bust, right?  Under certain conditions a pointer to a buffer
on the stack is returned.

Reply via email to