[PATCH] Fix getopt on arm platforms

Lluís Batlle i Rossell
2012-11-30T10:08:39Z

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 --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;
--
1.8.0

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