diff mbox

Fix getopt on arm platforms

Message ID 20121130100839.GA25766@vicerveza.homeunix.net (mailing list archive)
State New, archived
Headers show

Commit Message

LluĂ­s Batlle i Rossell Nov. 30, 2012, 10:08 a.m. UTC
There, 'char' is unsigned, so once assigned '-1' from getopt, it gets
the value 255. Then, it compared to '-1' gives false.
---
 cmds-scrub.c | 2 +-
 cmds-send.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/cmds-scrub.c b/cmds-scrub.c
index 24be20f..c972e3b 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -1604,7 +1604,7 @@  static int cmd_scrub_status(int argc, char **argv)
 	int i;
 	int print_raw = 0;
 	int do_stats_per_dev = 0;
-	char c;
+	int c;
 	char fsid[37];
 	int fdres = -1;
 	int err = 0;
diff --git a/cmds-send.c b/cmds-send.c
index 9b47e70..2e44114 100644
--- a/cmds-send.c
+++ b/cmds-send.c
@@ -414,7 +414,7 @@  out:
 int cmd_send_start(int argc, char **argv)
 {
 	char *subvol = NULL;
-	char c;
+	int c;
 	int ret;
 	char *outname = NULL;
 	struct btrfs_send send;