Skip to contentSkip to conversation

Change in openvpn[master]: remove newline characters at the end of msg() calls

Openvpn-devel In review cron2 (Code Review) 3 participants 6 messages Sep 11, 2025 – Sep 12, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1757613551000.I889b53ed72efaec546a6609491fae9715726ea00@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email

to review the following change.

Change subject: remove newline characters at the end of msg() calls
......................................................................

remove newline characters at the end of msg() calls

Unlike debugging with printf(), or msg() calls do not need or want a '\n' at the end of the string. Remove those that were overlooked.

Change-Id I889b53ed72efaec546a6609491fae9715726ea00

---
M src/openvpn/multi.c
M src/openvpn/plugin.c
M src/openvpn/socket_util.h
M src/openvpn/tun.c
M src/openvpn/xkey_helper.c
M src/openvpn/xkey_provider.c
M tests/unit_tests/openvpn/test_cryptoapi.c
M tests/unit_tests/openvpn/test_pkcs11.c

8 files changed, 15 insertions(+), 15 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/80/1180/1

src/openvpn/multi.c +1 -1
index 85975ff..7db4eda 100644
@@ -1036,7 +1036,7 @@
 #ifdef ENABLE_ASYNC_PUSH
     if (m->inotify_watchers)
     {
-        msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
+        msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
     }
 #endif
 }
src/openvpn/plugin.c +1 -1
index e65a3bc..ea76a08 100644
@@ -1007,7 +1007,7 @@
         msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
         while (l)
         {
-            msg(msglevel, "[%d] '%s' -> '%s'\n", ++count, l->name, l->value);
+            msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
             l = l->next;
         }
     }
src/openvpn/socket_util.h +1 -1
index 5ea37dd..361edff 100644
@@ -475,7 +475,7 @@
         default:
 #if 0
             /* could be called from socket_do_accept() with empty addr */
-            msg(M_ERR, "Bad address family: %d\n", af);
+            msg(M_ERR, "Bad address family: %d", af);
             ASSERT(0);
 #endif
             return 0;
src/openvpn/tun.c +6 -6
index 6c3096b..29f74a2 100644
@@ -2392,7 +2392,7 @@
     {
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
         ifr.lifr_ppa = ppa;
@@ -2403,7 +2403,7 @@
         }
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         /* Push arp module to if_fd */
         if (ioctl(if_fd, I_PUSH, "arp") < 0)
@@ -2422,18 +2422,18 @@
         /* Push arp module to ip_fd */
         if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Open arp_fd */
         if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
         {
-            msg(M_ERR, "Can't open %s\n", arp_node);
+            msg(M_ERR, "Can't open %s", arp_node);
         }
         /* Push arp module to arp_fd */
         if (ioctl(arp_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Set ifname to arp */
@@ -2443,7 +2443,7 @@
         strioc_if.ic_dp = (char *)&ifr;
         if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
         {
-            msg(M_ERR, "Can't set ifname to arp\n");
+            msg(M_ERR, "Can't set ifname to arp");
         }
     }
 
src/openvpn/xkey_helper.c +2 -2
index 3820808..72a24b5 100644
@@ -53,7 +53,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -429,7 +429,7 @@
     if (derlen > (int)capacity)
     {
         ECDSA_SIG_free(ecsig);
-        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
+        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
         return 0;
     }
     derlen = i2d_ECDSA_SIG(ecsig, &buf);
src/openvpn/xkey_provider.c +1 -1
index 1819ab0..168b554 100644
@@ -944,7 +944,7 @@
 signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
                const unsigned char *tbs, size_t tbslen)
 {
-    xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
+    xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
 
     XKEY_SIGNATURE_CTX *sctx = ctx;
     ASSERT(sctx);
tests/unit_tests/openvpn/test_cryptoapi.c +1 -1
index 0cfc952..6e83465 100644
@@ -64,7 +64,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
tests/unit_tests/openvpn/test_pkcs11.c +2 -2
index 56125df..9ba6cfc 100644
@@ -52,7 +52,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -170,7 +170,7 @@
     }
     else
     {
-        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored\n", prefix);
+        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored", prefix);
         ret = false;
     }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I889b53ed72efaec546a6609491fae9715726ea00
Gerrit-Change-Number: 1180
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email )

Change subject: remove newline characters at the end of msg() calls
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I889b53ed72efaec546a6609491fae9715726ea00
Gerrit-Change-Number: 1180
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Comment-Date: Fri, 12 Sep 2025 09:44:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 remove newline characters at the end of msg() calls

In reply to a message not in the archive

From: Gert Doering <[email protected]...>

Unlike debugging with printf(), or msg() calls do not need or want a '\n' at the end of the string. Remove those that were overlooked.

Change-Id I889b53ed72efaec546a6609491fae9715726ea00

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1180
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

src/openvpn/multi.c +1 -1
index 85975ff..7db4eda 100644
@@ -1036,7 +1036,7 @@
 #ifdef ENABLE_ASYNC_PUSH
     if (m->inotify_watchers)
     {
-        msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
+        msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
     }
 #endif
 }
src/openvpn/plugin.c +1 -1
index e65a3bc..ea76a08 100644
@@ -1007,7 +1007,7 @@
         msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
         while (l)
         {
-            msg(msglevel, "[%d] '%s' -> '%s'\n", ++count, l->name, l->value);
+            msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
             l = l->next;
         }
     }
src/openvpn/socket_util.h +1 -1
index 5ea37dd..361edff 100644
@@ -475,7 +475,7 @@
         default:
 #if 0
             /* could be called from socket_do_accept() with empty addr */
-            msg(M_ERR, "Bad address family: %d\n", af);
+            msg(M_ERR, "Bad address family: %d", af);
             ASSERT(0);
 #endif
             return 0;
src/openvpn/tun.c +6 -6
index 6c3096b..29f74a2 100644
@@ -2392,7 +2392,7 @@
     {
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
         ifr.lifr_ppa = ppa;
@@ -2403,7 +2403,7 @@
         }
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         /* Push arp module to if_fd */
         if (ioctl(if_fd, I_PUSH, "arp") < 0)
@@ -2422,18 +2422,18 @@
         /* Push arp module to ip_fd */
         if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Open arp_fd */
         if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
         {
-            msg(M_ERR, "Can't open %s\n", arp_node);
+            msg(M_ERR, "Can't open %s", arp_node);
         }
         /* Push arp module to arp_fd */
         if (ioctl(arp_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Set ifname to arp */
@@ -2443,7 +2443,7 @@
         strioc_if.ic_dp = (char *)&ifr;
         if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
         {
-            msg(M_ERR, "Can't set ifname to arp\n");
+            msg(M_ERR, "Can't set ifname to arp");
         }
     }
 
src/openvpn/xkey_helper.c +2 -2
index 3820808..72a24b5 100644
@@ -53,7 +53,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -429,7 +429,7 @@
     if (derlen > (int)capacity)
     {
         ECDSA_SIG_free(ecsig);
-        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
+        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
         return 0;
     }
     derlen = i2d_ECDSA_SIG(ecsig, &buf);
src/openvpn/xkey_provider.c +1 -1
index 1819ab0..168b554 100644
@@ -944,7 +944,7 @@
 signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
                const unsigned char *tbs, size_t tbslen)
 {
-    xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
+    xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
 
     XKEY_SIGNATURE_CTX *sctx = ctx;
     ASSERT(sctx);
tests/unit_tests/openvpn/test_cryptoapi.c +1 -1
index 0cfc952..6e83465 100644
@@ -64,7 +64,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
tests/unit_tests/openvpn/test_pkcs11.c +2 -2
index 56125df..9ba6cfc 100644
@@ -52,7 +52,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -170,7 +170,7 @@
     }
     else
     {
-        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored\n", prefix);
+        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored", prefix);
         ret = false;
     }
 
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: remove newline characters at the end of msg() calls

Not much to test here - it's just string constants, so if buildbot is fine & Frank is fine, all is good :-)

Again, links adjusted mail-archive.org -> sf.net + gerrit.

Your patch has been applied to the master + release/2.6 branch (bugfix).

commit 340b5b2d264a47c24aa948efb83ffa04e0e9c7e2 (master) commit a88c33f8db062b2224fce2fa28acfc7d222907d3 (release/2.6)

Author: Gert Doering
Date:   Fri Sep 12 15:16:09 2025 +0200
     remove newline characters at the end of msg() calls

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59232448/
     URL: https://gerrit.openvpn.net/c/openvpn/+/1180
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: remove newline characters at the end of msg() calls
......................................................................

remove newline characters at the end of msg() calls

Unlike debugging with printf(), or msg() calls do not need or want a '\n' at the end of the string. Remove those that were overlooked.

Change-Id I889b53ed72efaec546a6609491fae9715726ea00

Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59232448/
URL: https://gerrit.openvpn.net/c/openvpn/+/1180

---
M src/openvpn/multi.c
M src/openvpn/plugin.c
M src/openvpn/socket_util.h
M src/openvpn/tun.c
M src/openvpn/xkey_helper.c
M src/openvpn/xkey_provider.c
M tests/unit_tests/openvpn/test_cryptoapi.c
M tests/unit_tests/openvpn/test_pkcs11.c

8 files changed, 15 insertions(+), 15 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/80/1180/2

src/openvpn/multi.c +1 -1
index 85975ff..7db4eda 100644
@@ -1036,7 +1036,7 @@
 #ifdef ENABLE_ASYNC_PUSH
     if (m->inotify_watchers)
     {
-        msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
+        msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
     }
 #endif
 }
src/openvpn/plugin.c +1 -1
index e65a3bc..ea76a08 100644
@@ -1007,7 +1007,7 @@
         msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
         while (l)
         {
-            msg(msglevel, "[%d] '%s' -> '%s'\n", ++count, l->name, l->value);
+            msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
             l = l->next;
         }
     }
src/openvpn/socket_util.h +1 -1
index 5ea37dd..361edff 100644
@@ -475,7 +475,7 @@
         default:
 #if 0
             /* could be called from socket_do_accept() with empty addr */
-            msg(M_ERR, "Bad address family: %d\n", af);
+            msg(M_ERR, "Bad address family: %d", af);
             ASSERT(0);
 #endif
             return 0;
src/openvpn/tun.c +6 -6
index 6c3096b..29f74a2 100644
@@ -2392,7 +2392,7 @@
     {
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
         ifr.lifr_ppa = ppa;
@@ -2403,7 +2403,7 @@
         }
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         /* Push arp module to if_fd */
         if (ioctl(if_fd, I_PUSH, "arp") < 0)
@@ -2422,18 +2422,18 @@
         /* Push arp module to ip_fd */
         if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Open arp_fd */
         if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
         {
-            msg(M_ERR, "Can't open %s\n", arp_node);
+            msg(M_ERR, "Can't open %s", arp_node);
         }
         /* Push arp module to arp_fd */
         if (ioctl(arp_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Set ifname to arp */
@@ -2443,7 +2443,7 @@
         strioc_if.ic_dp = (char *)&ifr;
         if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
         {
-            msg(M_ERR, "Can't set ifname to arp\n");
+            msg(M_ERR, "Can't set ifname to arp");
         }
     }
 
src/openvpn/xkey_helper.c +2 -2
index 3820808..72a24b5 100644
@@ -53,7 +53,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -429,7 +429,7 @@
     if (derlen > (int)capacity)
     {
         ECDSA_SIG_free(ecsig);
-        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
+        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
         return 0;
     }
     derlen = i2d_ECDSA_SIG(ecsig, &buf);
src/openvpn/xkey_provider.c +1 -1
index 1819ab0..168b554 100644
@@ -944,7 +944,7 @@
 signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
                const unsigned char *tbs, size_t tbslen)
 {
-    xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
+    xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
 
     XKEY_SIGNATURE_CTX *sctx = ctx;
     ASSERT(sctx);
tests/unit_tests/openvpn/test_cryptoapi.c +1 -1
index 0cfc952..6e83465 100644
@@ -64,7 +64,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
tests/unit_tests/openvpn/test_pkcs11.c +2 -2
index 56125df..9ba6cfc 100644
@@ -52,7 +52,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -170,7 +170,7 @@
     }
     else
     {
-        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored\n", prefix);
+        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored", prefix);
         ret = false;
     }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I889b53ed72efaec546a6609491fae9715726ea00
Gerrit-Change-Number: 1180
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email )

Change subject: remove newline characters at the end of msg() calls
......................................................................

remove newline characters at the end of msg() calls

Unlike debugging with printf(), or msg() calls do not need or want a '\n' at the end of the string. Remove those that were overlooked.

Change-Id I889b53ed72efaec546a6609491fae9715726ea00

Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/59232448/
URL: https://gerrit.openvpn.net/c/openvpn/+/1180

---
M src/openvpn/multi.c
M src/openvpn/plugin.c
M src/openvpn/socket_util.h
M src/openvpn/tun.c
M src/openvpn/xkey_helper.c
M src/openvpn/xkey_provider.c
M tests/unit_tests/openvpn/test_cryptoapi.c
M tests/unit_tests/openvpn/test_pkcs11.c

8 files changed, 15 insertions(+), 15 deletions(-)
src/openvpn/multi.c +1 -1
index 85975ff..7db4eda 100644
@@ -1036,7 +1036,7 @@
 #ifdef ENABLE_ASYNC_PUSH
     if (m->inotify_watchers)
     {
-        msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
+        msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
     }
 #endif
 }
src/openvpn/plugin.c +1 -1
index e65a3bc..ea76a08 100644
@@ -1007,7 +1007,7 @@
         msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
         while (l)
         {
-            msg(msglevel, "[%d] '%s' -> '%s'\n", ++count, l->name, l->value);
+            msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
             l = l->next;
         }
     }
src/openvpn/socket_util.h +1 -1
index 5ea37dd..361edff 100644
@@ -475,7 +475,7 @@
         default:
 #if 0
             /* could be called from socket_do_accept() with empty addr */
-            msg(M_ERR, "Bad address family: %d\n", af);
+            msg(M_ERR, "Bad address family: %d", af);
             ASSERT(0);
 #endif
             return 0;
src/openvpn/tun.c +6 -6
index 6c3096b..29f74a2 100644
@@ -2392,7 +2392,7 @@
     {
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
         ifr.lifr_ppa = ppa;
@@ -2403,7 +2403,7 @@
         }
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
         {
-            msg(M_ERR, "Can't get flags\n");
+            msg(M_ERR, "Can't get flags");
         }
         /* Push arp module to if_fd */
         if (ioctl(if_fd, I_PUSH, "arp") < 0)
@@ -2422,18 +2422,18 @@
         /* Push arp module to ip_fd */
         if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Open arp_fd */
         if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
         {
-            msg(M_ERR, "Can't open %s\n", arp_node);
+            msg(M_ERR, "Can't open %s", arp_node);
         }
         /* Push arp module to arp_fd */
         if (ioctl(arp_fd, I_PUSH, "arp") < 0)
         {
-            msg(M_ERR, "Can't push ARP module\n");
+            msg(M_ERR, "Can't push ARP module");
         }
 
         /* Set ifname to arp */
@@ -2443,7 +2443,7 @@
         strioc_if.ic_dp = (char *)&ifr;
         if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
         {
-            msg(M_ERR, "Can't set ifname to arp\n");
+            msg(M_ERR, "Can't set ifname to arp");
         }
     }
 
src/openvpn/xkey_helper.c +2 -2
index 3820808..72a24b5 100644
@@ -53,7 +53,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -429,7 +429,7 @@
     if (derlen > (int)capacity)
     {
         ECDSA_SIG_free(ecsig);
-        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
+        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
         return 0;
     }
     derlen = i2d_ECDSA_SIG(ecsig, &buf);
src/openvpn/xkey_provider.c +1 -1
index 1819ab0..168b554 100644
@@ -944,7 +944,7 @@
 signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
                const unsigned char *tbs, size_t tbslen)
 {
-    xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
+    xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
 
     XKEY_SIGNATURE_CTX *sctx = ctx;
     ASSERT(sctx);
tests/unit_tests/openvpn/test_cryptoapi.c +1 -1
index 0cfc952..6e83465 100644
@@ -64,7 +64,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
tests/unit_tests/openvpn/test_pkcs11.c +2 -2
index 56125df..9ba6cfc 100644
@@ -52,7 +52,7 @@
     unsigned long e;
     while ((e = ERR_get_error()))
     {
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
     }
 }
 
@@ -170,7 +170,7 @@
     }
     else
     {
-        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored\n", prefix);
+        msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored", prefix);
         ret = false;
     }
 

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1180?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I889b53ed72efaec546a6609491fae9715726ea00
Gerrit-Change-Number: 1180
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged