From: David Sterba <dsterba@suse.cz>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH] btrfs-progs: Fix getopt on arm/ppc platforms
Date: Tue, 9 Jul 2013 18:38:29 +0200 [thread overview]
Message-ID: <1373387909-30885-1-git-send-email-dsterba@suse.cz> (raw)
(same as commit bb0eabc383e9a3fde7cdb02591ca88243f3e31fb)
There, 'char' is unsigned, so once assigned '-1' from getopt, it gets
the value 255. Then, it compared to '-1' gives false.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
btrfs-crc.c | 2 +-
cmds-device.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/btrfs-crc.c b/btrfs-crc.c
index e4cda43..1990534 100644
--- a/btrfs-crc.c
+++ b/btrfs-crc.c
@@ -34,7 +34,7 @@ void usage(void)
int main(int argc, char **argv)
{
- char c;
+ int c;
unsigned long checksum = 0;
char *str;
char *buf;
diff --git a/cmds-device.c b/cmds-device.c
index 41e79d3..9e7328b 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -294,7 +294,7 @@ static int cmd_dev_stats(int argc, char **argv)
int ret;
int fdmnt;
int i;
- char c;
+ int c;
int err = 0;
__u64 flags = 0;
--
1.8.2
reply other threads:[~2013-07-09 16:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1373387909-30885-1-git-send-email-dsterba@suse.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).