[][openwrt][common][app][Fix base to 0 of strtoul in switch app]
[Description]
Fix base to 0 of strtoul to align application note for switch app
[Release-log]
N/A
Change-Id: I205403b7cbb25c95b09426e758240be7a6450272
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9750121
diff --git a/feed/app/switch/src/switch_753x.c b/feed/app/switch/src/switch_753x.c
index 03e9778..a2cd8a2 100644
--- a/feed/app/switch/src/switch_753x.c
+++ b/feed/app/switch/src/switch_753x.c
@@ -530,7 +530,7 @@
switch (op) {
case 'r':
- reg = strtoul(argv[argc - 1], NULL, 16);
+ reg = strtoul(argv[argc - 1], NULL, 0);
if (reg >= 0xFFFFFFFF) {
printf(" Phy read reg fail\n");
ret = -1;
@@ -552,7 +552,7 @@
printf(" Phy read reg=0x%x, value=0x%x\n",
reg, value);
} else if (argc == 7) {
- dev_num = strtoul(argv[argc - 2], NULL, 16);
+ dev_num = strtoul(argv[argc - 2], NULL, 0);
if (dev_num > 0xFFFFFFFF) {
printf(" Phy read reg fail\n");
ret = -1;
@@ -577,7 +577,7 @@
ret = phy_dump(32);
break;
case 'w':
- reg = strtoul(argv[argc - 2], NULL, 16);
+ reg = strtoul(argv[argc - 2], NULL, 0);
if (reg >= 0xFFFFFFFF) {
printf(" Phy write reg fail\n");
ret = -1;
@@ -607,7 +607,7 @@
printf(" Phy write reg=0x%x, value=0x%x\n",
reg, cl_value);
} else if (argc == 8) {
- dev_num = strtoul(argv[argc - 3], NULL, 16);
+ dev_num = strtoul(argv[argc - 3], NULL, 0);
if (dev_num > 0xFFFFFFFF) {
printf(" Phy write reg fail\n");
ret = -1;