public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Honggang LI <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [rdma-core/rdma-ndd] Use integer as getopt_long returns integer
Date: Tue, 25 Apr 2017 13:49:52 +0800	[thread overview]
Message-ID: <1493099392-1883-1-git-send-email-honli@redhat.com> (raw)

From: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

ARM chars are unsigned by default. getopt_long return 255 instead -1.
That will cause an endless loop for aarch64 platform.

Signed-off-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 rdma-ndd/rdma-ndd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c
index 1579a02..e7be22b 100644
--- a/rdma-ndd/rdma-ndd.c
+++ b/rdma-ndd/rdma-ndd.c
@@ -297,7 +297,7 @@ int main(int argc, char *argv[])
 			{ }
 		};
 
-		char c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
+		int c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
 		if (c == -1)
 			break;
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2017-04-25  5:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  5:49 Honggang LI [this message]
     [not found] ` <1493099392-1883-1-git-send-email-honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-25 19:47   ` [rdma-core/rdma-ndd] Use integer as getopt_long returns integer Jason Gunthorpe
2017-04-25 20:10   ` Jonathan Toppins
2017-04-26  6:21   ` Leon Romanovsky

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=1493099392-1883-1-git-send-email-honli@redhat.com \
    --to=honli-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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