]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-clone: proper type for getopt_long result
authorBogdan Purcareata <bogdan.purcareata@freescale.com>
Mon, 9 Dec 2013 14:39:46 +0000 (16:39 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 9 Dec 2013 19:59:05 +0000 (14:59 -0500)
While char is a signed type and should have no trouble
storing a "-1" value, getopt_long() will return a value of 255
instead of -1. This has been noticed on powerpc; there's also
some upstream talk about it at [1].

Change variable type from char to int, since it's also the
documented use.

[1] http://stackoverflow.com/questions/17070958/c-why-does-getopt-return-255-on-linux

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxc_clone.c

index 4639a90df8ac5040f2a82193ae89945719346851..88a768dba8293d3d081bcd21cc481663969eb98d 100644 (file)
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
        char *bdevtype = NULL, *lxcpath = NULL, *newpath = NULL, *fstype = NULL;
        char *orig = NULL, *new = NULL, *vgname = NULL;
        char **args = NULL;
-       char c;
+       int c;
 
        if (argc < 3)
                usage(argv[0]);