Skip to content

Commit 340b5b2

Browse files
committed
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 <[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]>
1 parent c3600e9 commit 340b5b2

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

src/openvpn/multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ multi_print_status(struct multi_context *m, struct status_output *so, const int
10361036
#ifdef ENABLE_ASYNC_PUSH
10371037
if (m->inotify_watchers)
10381038
{
1039-
msg(D_MULTI_DEBUG, "inotify watchers count: %d\n", hash_n_elements(m->inotify_watchers));
1039+
msg(D_MULTI_DEBUG, "inotify watchers count: %d", hash_n_elements(m->inotify_watchers));
10401040
}
10411041
#endif
10421042
}

src/openvpn/plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ plugin_return_print(const int msglevel, const char *prefix, const struct plugin_
10071007
msg(msglevel, "PLUGIN #%d (%s)", i, prefix);
10081008
while (l)
10091009
{
1010-
msg(msglevel, "[%d] '%s' -> '%s'\n", ++count, l->name, l->value);
1010+
msg(msglevel, "[%d] '%s' -> '%s'", ++count, l->name, l->value);
10111011
l = l->next;
10121012
}
10131013
}

src/openvpn/socket_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ af_addr_size(sa_family_t af)
475475
default:
476476
#if 0
477477
/* could be called from socket_do_accept() with empty addr */
478-
msg(M_ERR, "Bad address family: %d\n", af);
478+
msg(M_ERR, "Bad address family: %d", af);
479479
ASSERT(0);
480480
#endif
481481
return 0;

src/openvpn/tun.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
23922392
{
23932393
if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
23942394
{
2395-
msg(M_ERR, "Can't get flags\n");
2395+
msg(M_ERR, "Can't get flags");
23962396
}
23972397
strncpynt(ifr.lifr_name, tt->actual_name, sizeof(ifr.lifr_name));
23982398
ifr.lifr_ppa = ppa;
@@ -2403,7 +2403,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
24032403
}
24042404
if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
24052405
{
2406-
msg(M_ERR, "Can't get flags\n");
2406+
msg(M_ERR, "Can't get flags");
24072407
}
24082408
/* Push arp module to if_fd */
24092409
if (ioctl(if_fd, I_PUSH, "arp") < 0)
@@ -2422,18 +2422,18 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
24222422
/* Push arp module to ip_fd */
24232423
if (ioctl(tt->ip_fd, I_PUSH, "arp") < 0)
24242424
{
2425-
msg(M_ERR, "Can't push ARP module\n");
2425+
msg(M_ERR, "Can't push ARP module");
24262426
}
24272427

24282428
/* Open arp_fd */
24292429
if ((arp_fd = open(arp_node, O_RDWR, 0)) < 0)
24302430
{
2431-
msg(M_ERR, "Can't open %s\n", arp_node);
2431+
msg(M_ERR, "Can't open %s", arp_node);
24322432
}
24332433
/* Push arp module to arp_fd */
24342434
if (ioctl(arp_fd, I_PUSH, "arp") < 0)
24352435
{
2436-
msg(M_ERR, "Can't push ARP module\n");
2436+
msg(M_ERR, "Can't push ARP module");
24372437
}
24382438

24392439
/* Set ifname to arp */
@@ -2443,7 +2443,7 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
24432443
strioc_if.ic_dp = (char *)&ifr;
24442444
if (ioctl(arp_fd, I_STR, &strioc_if) < 0)
24452445
{
2446-
msg(M_ERR, "Can't set ifname to arp\n");
2446+
msg(M_ERR, "Can't set ifname to arp");
24472447
}
24482448
}
24492449

src/openvpn/xkey_helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ print_openssl_errors(void)
5353
unsigned long e;
5454
while ((e = ERR_get_error()))
5555
{
56-
msg(M_WARN, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
56+
msg(M_WARN, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
5757
}
5858
}
5959

@@ -429,7 +429,7 @@ ecdsa_bin2der(unsigned char *buf, int len, size_t capacity)
429429
if (derlen > (int)capacity)
430430
{
431431
ECDSA_SIG_free(ecsig);
432-
msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)\n", derlen);
432+
msg(M_NONFATAL, "Error: DER encoded ECDSA signature is too long (%d)", derlen);
433433
return 0;
434434
}
435435
derlen = i2d_ECDSA_SIG(ecsig, &buf);

src/openvpn/xkey_provider.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ static int
944944
signature_sign(void *ctx, unsigned char *sig, size_t *siglen, size_t sigsize,
945945
const unsigned char *tbs, size_t tbslen)
946946
{
947-
xkey_dmsg(D_XKEY, "entry with siglen = %zu\n", *siglen);
947+
xkey_dmsg(D_XKEY, "entry with siglen = %zu", *siglen);
948948

949949
XKEY_SIGNATURE_CTX *sctx = ctx;
950950
ASSERT(sctx);

tests/unit_tests/openvpn/test_cryptoapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ crypto_print_openssl_errors(const unsigned int flags)
6464
unsigned long e;
6565
while ((e = ERR_get_error()))
6666
{
67-
msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
67+
msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
6868
}
6969
}
7070

tests/unit_tests/openvpn/test_pkcs11.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ crypto_print_openssl_errors(const unsigned int flags)
5252
unsigned long e;
5353
while ((e = ERR_get_error()))
5454
{
55-
msg(flags, "OpenSSL error %lu: %s\n", e, ERR_error_string(e, NULL));
55+
msg(flags, "OpenSSL error %lu: %s", e, ERR_error_string(e, NULL));
5656
}
5757
}
5858

@@ -170,7 +170,7 @@ get_user_pass_cr(struct user_pass *up, const char *auth_file, const char *prefix
170170
}
171171
else
172172
{
173-
msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored\n", prefix);
173+
msg(M_NONFATAL, "ERROR: get_user_pass called with unknown request <%s> ignored", prefix);
174174
ret = false;
175175
}
176176

0 commit comments

Comments
 (0)