gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: util: Fix regression with optional newli


From: gnunet
Subject: [gnunet] branch master updated: util: Fix regression with optional newline logging
Date: Mon, 18 Nov 2024 19:58:45 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new e11ee3d3f util: Fix regression with optional newline logging
e11ee3d3f is described below

commit e11ee3d3fdc9cc0cfaf318fda467f70c2f925932
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Mon Nov 18 19:58:36 2024 +0100

    util: Fix regression with optional newline logging
---
 src/lib/util/common_logging.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lib/util/common_logging.c b/src/lib/util/common_logging.c
index 5d26a5a0e..f68db5377 100644
--- a/src/lib/util/common_logging.c
+++ b/src/lib/util/common_logging.c
@@ -824,11 +824,11 @@ output_message (enum GNUNET_ErrorType kind,
 {
   static int have_journald = -1;
   struct CustomLogger *pos;
-  char optional_newline = '\n';
+  char *optional_newline = "\n";
 
   if ((strlen (msg) > 0) &&
       ('\n' == msg[strlen (msg) - 1]))
-    optional_newline = '\0';
+    optional_newline = "";
 
   if (-1 == have_journald)
   {
@@ -855,7 +855,7 @@ output_message (enum GNUNET_ErrorType kind,
        * this way if the output is going to logfiles or robots
        * instead.
        */
-      fprintf (GNUNET_stderr, "* %s", msg);
+      fprintf (GNUNET_stderr, "* %s%s", msg, optional_newline);
     }
     else if (GNUNET_YES == current_async_scope.have_scope)
     {
@@ -873,14 +873,14 @@ output_message (enum GNUNET_ErrorType kind,
       skip_log = 0;
       if (have_journald)
         fprintf (GNUNET_stderr,
-                 "(%s) %s %s%c",
+                 "(%s) %s %s%s",
                  id_buf,
                  GNUNET_error_type_to_string (kind),
                  msg,
                  optional_newline);
       else
         fprintf (GNUNET_stderr,
-                 "%s %s(%s) %s %s%c",
+                 "%s %s(%s) %s %s%s",
                  datestr,
                  comp,
                  id_buf,
@@ -892,13 +892,13 @@ output_message (enum GNUNET_ErrorType kind,
     {
       if (have_journald)
         fprintf (GNUNET_stderr,
-                 "%s %s%c",
+                 "%s %s%s",
                  GNUNET_error_type_to_string (kind),
                  msg,
                  optional_newline);
       else
         fprintf (GNUNET_stderr,
-                 "%s %s %s %s%c",
+                 "%s %s %s %s%s",
                  datestr,
                  comp,
                  GNUNET_error_type_to_string (kind),

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]