From: David Sterba Date: Tue, 9 Jul 2013 16:38:29 +0000 (+0200) Subject: btrfs-progs: Fix getopt on arm/ppc platforms X-Git-Tag: upstream/4.16.1~3225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=309e50c7634f0603dab866ad699e7981e9fca004;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: Fix getopt on arm/ppc platforms (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 Signed-off-by: Chris Mason --- diff --git a/btrfs-crc.c b/btrfs-crc.c index e4cda431..1990534a 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 41e79d37..9e7328b2 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;