]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/log.c
Configure: Implemented running of test programs
[libucw.git] / ucw / log.c
index 5a5dc808c9487ba8d479a896187678701387445f..7a870261d8ac2379f61ecf69aa0cfd296d15eea7 100644 (file)
--- a/ucw/log.c
+++ b/ucw/log.c
@@ -45,8 +45,10 @@ struct log_stream log_stream_default = {
   .types = ~0U,
   .msgfmt = LSFMT_DEFAULT,
   // an empty clist
-  .substreams.head.next = (cnode *) &log_stream_default.substreams.head,
-  .substreams.head.prev = (cnode *) &log_stream_default.substreams.head,
+  .substreams.head = {
+    .next = (cnode *) &log_stream_default.substreams.head,
+    .prev = (cnode *) &log_stream_default.substreams.head,
+  },
 };
 
 /*** Registry of streams and their identifiers ***/
@@ -118,6 +120,7 @@ vmsg(uns cat, const char *fmt, va_list args)
     {
       /* CAVEAT: These calls are not safe in signal handlers. */
       gettimeofday(&tv, NULL);
+      m.tv = &tv;
       if (localtime_r(&tv.tv_sec, &tm))
        m.tm = &tm;
     }
@@ -152,7 +155,7 @@ vmsg(uns cat, const char *fmt, va_list args)
   p = m.raw_msg;
   while (*p)
     {
-      if (*p < 0x20 && *p != '\t')
+      if (*p >= 0 && *p < 0x20 && *p != '\t')
        *p = 0x7f;
       p++;
     }