Fixed using myoptarg instead of optarg

This commit is contained in:
bazooka joe
2019-02-18 20:23:03 +02:00
committed by Beat Küng
parent ae335f6bd8
commit 7bac0e03de
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -1947,11 +1947,11 @@ lsm303d_main(int argc, char *argv[])
break;
case 'R':
rotation = (enum Rotation)atoi(optarg);
rotation = (enum Rotation)atoi(myoptarg);
break;
case 'a':
accel_range = atoi(optarg);
accel_range = atoi(myoptarg);
break;
default:
+2 -2
View File
@@ -1621,11 +1621,11 @@ oreoled_main(int argc, char *argv[])
while ((ch = px4_getopt(argc, argv, "a:b:", &myoptind, &myoptarg)) != EOF) {
switch (ch) {
case 'a':
i2c_addr = (int)strtol(optarg, NULL, 0);
i2c_addr = (int)strtol(myoptarg, NULL, 0);
break;
case 'b':
i2cdevice = (int)strtol(optarg, NULL, 0);
i2cdevice = (int)strtol(myoptarg, NULL, 0);
break;
default:
+2 -2
View File
@@ -381,11 +381,11 @@ pca8574_main(int argc, char *argv[])
while ((ch = px4_getopt(argc, argv, "a:b:", &myoptind, &myoptarg)) != EOF) {
switch (ch) {
case 'a':
pca8574adr = strtol(optarg, NULL, 0);
pca8574adr = strtol(myoptarg, NULL, 0);
break;
case 'b':
i2cdevice = strtol(optarg, NULL, 0);
i2cdevice = strtol(myoptarg, NULL, 0);
break;
default:
+1 -1
View File
@@ -545,7 +545,7 @@ pca9685_main(int argc, char *argv[])
break;
case 'b':
i2cdevice = strtol(optarg, NULL, 0);
i2cdevice = strtol(myoptarg, NULL, 0);
break;
default: