btrfs-progs: Fix getopt on arm/ppc platforms
authorDavid Sterba <dsterba@suse.cz>
Tue, 9 Jul 2013 16:38:29 +0000 (18:38 +0200)
committerDavid Sterba <dsterba@suse.cz>
Fri, 9 Aug 2013 12:32:34 +0000 (14:32 +0200)
(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>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
btrfs-crc.c
cmds-device.c

index e4cda431270067d0ecc0137cabe75b8d03d0070a..1990534ad4d24bc2399ef92c4d42ae475183323d 100644 (file)
@@ -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;
index 41e79d375ce4fdd4ed865397614b9c3365224615..9e7328b20a55567c2fc2daaf7e1f44c013d9aa90 100644 (file)
@@ -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;