Commit d2bf7945 by Bogdan Purcareata Committed by Stéphane Graber

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-linuxSigned-off-by: 's avatarBogdan Purcareata <bogdan.purcareata@freescale.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 359c71b6
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment