mnexec: getopt bugfix

getopt returns an 'int', so use change datatype of 'c' to match it.
Otherwise, 'c' may hold a value of 255 (0xff), and fail the comparison
with -1 (0xffffffff): while ((c = getopt(...)) != -1)

This bug was uncovered on Ubuntu 13.04 running on ARM, using
arm-linux-gnueabihf-gcc4.7.
This commit is contained in:
Zi Shen Lim
2013-09-18 10:33:15 -07:00
parent 4ccfe242e8
commit cae7be1a60
+1 -1
View File
@@ -92,7 +92,7 @@ int cgroup(char *gname)
int main(int argc, char *argv[])
{
char c;
int c;
int fd;
char path[PATH_MAX];
int nsid;