uint32_t flags = 0;
char *device = NULL;
char *target = NULL;
+ unsigned long tmp = 0;
while (1) {
int c = getopt_long(argc, argv, "+x:ocrf:d:t:", CMDLINE_OPTIONS, 0);
case 'd' : device = optarg; break;
case 't' : target = optarg; break;
case 'f' :
- if (!isNumberUnsigned(optarg, &flags, false)) {
+ if (!isNumberUnsigned(optarg, &tmp, false)) {
WRITE_MSG(2, "Invalid flags argument: '");
WRITE_STR(2, optarg);
WRITE_MSG(2, "'; try '--help' for more information\n");
return EXIT_FAILURE;
}
+ flags |= (uint32_t) tmp;
break;
default :
if (xid==VC_NOCTX)
WRITE_MSG(2, "No xid specified; try '--help' for more information\n");
+ else if (optind!=argc)
+ WRITE_MSG(2, "Unused argument(s); try '--help' for more information\n");
else if (vc_set_mapping(xid, device, target, flags)==-1)
perror("vc_set_mapping()");
else