netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Nault <gnault@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH iproute2-next 5/5] ipnetns: remove blank lines printed by invarg() messages
Date: Fri, 8 Nov 2019 18:00:20 +0100	[thread overview]
Message-ID: <b5f703efe94f691bd52391aefdf2db63182752cb.1573231189.git.gnault@redhat.com> (raw)
In-Reply-To: <cover.1573231189.git.gnault@redhat.com>

Since invarg() automatically adds a '\n' character, having one in the
error message generates an extra blank line.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
 ip/ipnetns.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 4eb4a09a..b22e5d62 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -439,10 +439,10 @@ static int netns_list_id(int argc, char **argv)
 			NEXT_ARG();
 
 			if (get_integer(&filter.target_nsid, *argv, 0))
-				invarg("\"target-nsid\" value is invalid\n",
+				invarg("\"target-nsid\" value is invalid",
 				       *argv);
 			else if (filter.target_nsid < 0)
-				invarg("\"target-nsid\" value should be >= 0\n",
+				invarg("\"target-nsid\" value should be >= 0",
 				       argv[1]);
 		} else if (strcmp(*argv, "nsid") == 0) {
 			if (nsid >= 0)
@@ -450,9 +450,9 @@ static int netns_list_id(int argc, char **argv)
 			NEXT_ARG();
 
 			if (get_integer(&nsid, *argv, 0))
-				invarg("\"nsid\" value is invalid\n", *argv);
+				invarg("\"nsid\" value is invalid", *argv);
 			else if (nsid < 0)
-				invarg("\"nsid\" value should be >= 0\n",
+				invarg("\"nsid\" value should be >= 0",
 				       argv[1]);
 		} else
 			usage();
@@ -932,9 +932,9 @@ static int netns_set(int argc, char **argv)
 	if (strcmp(argv[1], "auto") == 0)
 		nsid = -1;
 	else if (get_integer(&nsid, argv[1], 0))
-		invarg("Invalid \"netnsid\" value\n", argv[1]);
+		invarg("Invalid \"netnsid\" value", argv[1]);
 	else if (nsid < 0)
-		invarg("\"netnsid\" value should be >= 0\n", argv[1]);
+		invarg("\"netnsid\" value should be >= 0", argv[1]);
 
 	snprintf(netns_path, sizeof(netns_path), "%s/%s", NETNS_RUN_DIR, name);
 	netns = open(netns_path, O_RDONLY | O_CLOEXEC);
-- 
2.21.0


  parent reply	other threads:[~2019-11-08 17:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 17:00 [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 1/5] ipnetns: treat NETNSA_NSID and NETNSA_CURRENT_NSID as signed Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 2/5] ipnetns: fix misleading comment about 'ip monitor nsid' Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 3/5] ipnetns: harden helper functions wrt. negative netns ids Guillaume Nault
2019-11-08 17:00 ` [PATCH iproute2-next 4/5] ipnetns: don't print unassigned nsid in json export Guillaume Nault
2019-11-08 17:00 ` Guillaume Nault [this message]
2019-11-09  1:36 ` [PATCH iproute2-next 0/5] ipnetns: cleanup and harden processing of netns ids David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b5f703efe94f691bd52391aefdf2db63182752cb.1573231189.git.gnault@redhat.com \
    --to=gnault@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).