Browse code

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
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20250912131609.43444-1-frank@lichtenheld.com>
URL: https://sourceforge.net/p/openvpn/mailman/message/59232448/
URL: https://gerrit.openvpn.net/c/openvpn/+/1180
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 340b5b2d264a47c24aa948efb83ffa04e0e9c7e2)

Gert Doering authored on 2025/09/12 22:16:09
Showing 6 changed files
... ...
@@ -1041,7 +1041,7 @@ multi_print_status(struct multi_context *m, struct status_output *so, const int
1041 1041
 #ifdef ENABLE_ASYNC_PUSH
1042 1042
     if (m->inotify_watchers)
1043 1043
     {
1044
-        msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
1044
+        msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
1045 1045
     }
1046 1046
 #endif
1047 1047
 }
... ...
@@ -1036,7 +1036,7 @@ plugin_return_print(const int msglevel, const char *prefix, const struct plugin_
1036 1036
         msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
1037 1037
         while (l)
1038 1038
         {
1039
-            msg(msglevel, "[%d] '%s' -> '%s'\n",
1039
+            msg(msglevel, "[%d] '%s' -> '%s'",
1040 1040
                 ++count,
1041 1041
                 l->name,
1042 1042
                 l->value);
... ...
@@ -2530,7 +2530,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
2530 2530
     {
2531 2531
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
2532 2532
         {
2533
-            msg(M_ERR, "Can't get flags\n");
2533
+            msg(M_ERR, "Can't get flags");
2534 2534
         }
2535 2535
         strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
2536 2536
         ifr.lifr_ppa = ppa;
... ...
@@ -2541,7 +2541,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
2541 2541
         }
2542 2542
         if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) <0)
2543 2543
         {
2544
-            msg(M_ERR, "Can't get flags\n");
2544
+            msg(M_ERR, "Can't get flags");
2545 2545
         }
2546 2546
         /* Push arp module to if_fd */
2547 2547
         if (ioctl(if_fd, I_PUSH, "arp") < 0)
... ...
@@ -2560,18 +2560,18 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
2560 2560
         /* Push arp module to ip_fd */
2561 2561
         if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
2562 2562
         {
2563
-            msg(M_ERR, "Can't push ARP module\n");
2563
+            msg(M_ERR, "Can't push ARP module");
2564 2564
         }
2565 2565
 
2566 2566
         /* Open arp_fd */
2567 2567
         if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
2568 2568
         {
2569
-            msg(M_ERR, "Can't open %s\n", arp_node);
2569
+            msg(M_ERR, "Can't open %s", arp_node);
2570 2570
         }
2571 2571
         /* Push arp module to arp_fd */
2572 2572
         if (ioctl(arp_fd, I_PUSH, "arp") < 0)
2573 2573
         {
2574
-            msg(M_ERR, "Can't push ARP module\n");
2574
+            msg(M_ERR, "Can't push ARP module");
2575 2575
         }
2576 2576
 
2577 2577
         /* Set ifname to arp */
... ...
@@ -2581,7 +2581,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
2581 2581
         strioc_if.ic_dp = (char *)&ifr;
2582 2582
         if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
2583 2583
         {
2584
-            msg(M_ERR, "Can't set ifname to arp\n");
2584
+            msg(M_ERR, "Can't set ifname to arp");
2585 2585
         }
2586 2586
     }
2587 2587
 
... ...
@@ -54,7 +54,7 @@ print_openssl_errors()
54 54
     unsigned long e;
55 55
     while ((e = ERR_get_error()))
56 56
     {
57
-        msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
57
+        msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
58 58
     }
59 59
 }
60 60
 
... ...
@@ -431,7 +431,7 @@ ecdsa_bin2der(unsigned char *buf, int len, size_t capacity)
431 431
     if (derlen > (int) capacity)
432 432
     {
433 433
         ECDSA_SIG_free(ecsig);
434
-        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
434
+        msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
435 435
         return 0;
436 436
     }
437 437
     derlen = i2d_ECDSA_SIG(ecsig, &buf);
... ...
@@ -939,7 +939,7 @@ static int
939 939
 signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
940 940
                const unsigned char *tbs, size_t tbslen)
941 941
 {
942
-    xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
942
+    xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
943 943
 
944 944
     XKEY_SIGNATURE_CTX *sctx = ctx;
945 945
     ASSERT(sctx);
... ...
@@ -65,7 +65,7 @@ crypto_print_openssl_errors(const unsigned int flags)
65 65
     unsigned long e;
66 66
     while ((e = ERR_get_error()))
67 67
     {
68
-        msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
68
+        msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
69 69
     }
70 70
 }
71 71