Fixed using myoptarg instead of optarg

This commit is contained in:
bazooka joe
2019-02-21 09:45:45 +01:00
committed by Beat Küng
parent ae335f6bd8
commit 7bac0e03de
4 changed files with 7 additions and 7 deletions
+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: