diff --git a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/fani.c b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/fani.c index 903f8a8e34..f01c69ba83 100644 --- a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/fani.c +++ b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/fani.c @@ -155,8 +155,8 @@ static void ps_call_back(void *p) AIM_LOG_ERROR("Failed CURL response data.\n"); return; } - - i = data_loc_start - ptr; + /* Start to parse from the first value, ignore '[' */ + i = data_loc_start - ptr + 1; while (ptr[i] && ptr[i] != ']') { j = 0; @@ -180,11 +180,7 @@ static void ps_call_back(void *p) /* There are three string - model name/serial/model ver */ if ((k < curl_data_loc_psu_model_name) || (k > curl_data_loc_psu_model_ver)) { - /* To avoid to get error char in first item */ - if (k == 0) - ps[k] = atoi(str+1); - else - ps[k] = atoi(str); + ps[k] = atoi(str); } k++; diff --git a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/psui.c b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/psui.c index 79cac34b1e..a9c13995de 100644 --- a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/psui.c +++ b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/psui.c @@ -102,8 +102,8 @@ static void ps_call_back(void *p) AIM_LOG_ERROR("Failed CURL response data.\n"); return; } - - i = data_loc_start - ptr; + /* Start to parse from the first value, ignore '[' */ + i = data_loc_start - ptr + 1; while (ptr[i] && ptr[i] != ']') { j = 0; @@ -125,13 +125,9 @@ static void ps_call_back(void *p) /* There are three string - model name/serial/model ver */ if ((k < curl_data_loc_psu_model_name) || (k > curl_data_loc_psu_model_ver)) { - /* To avoid to get error char in first item */ - if (k == 0) - ps[k] = atoi(str+1); - else - ps[k] = atoi(str); - } - else + ps[k] = atoi(str); + } + else { switch (k) { diff --git a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/thermali.c b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/thermali.c index b645d07a69..f847a007e2 100644 --- a/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/thermali.c +++ b/packages/platforms/accton/x86-64/as9516-32d/onlp/builds/x86_64_accton_as9516_32d/module/src/thermali.c @@ -123,8 +123,8 @@ void tmp_call_back(void *p) AIM_LOG_ERROR("Failed CURL response data.\n"); return; } - - i = data_loc_start - ptr; + /* Start to parse from the first value, ignore '[' */ + i = data_loc_start - ptr + 1; while (ptr[i] && ptr[i] != ']') { j = 0; @@ -139,10 +139,7 @@ void tmp_call_back(void *p) if (k < curl_data_thermal_num) { - if (k == 0) - tmp[k] = atoi(str+1); - else - tmp[k] = atoi(str); + tmp[k] = atoi(str); k++; }