From: Bogdan Purcareata Date: Mon, 9 Dec 2013 14:39:46 +0000 (+0200) Subject: lxc-clone: proper type for getopt_long result X-Git-Tag: lxc-1.0.0.beta1~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2bf794591e47bbc2b66a2921440e9e0f0518359;p=thirdparty%2Flxc.git lxc-clone: proper type for getopt_long result 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 Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxc_clone.c b/src/lxc/lxc_clone.c index 4639a90df..88a768dba 100644 --- a/src/lxc/lxc_clone.c +++ b/src/lxc/lxc_clone.c @@ -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]);