Skip to content

Commit

Permalink
Add two if sentences about result_start.
Browse files Browse the repository at this point in the history
  • Loading branch information
zkf0 authored and YiluMao committed Apr 20, 2023
1 parent 5a9359c commit d7358cd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions solutions/py_engine_esp32_demo/activation/activation.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ int activation_parse_data(char *response_data)

ACTIVATION_DEBUG("response data: %s\n", response_data);
result_start = strstr(response_data, ACTIVATION_RESPONSE_RESULT_START);
if(result_start == NULL){
ACTIVATION_ERR("parse reponse result failed\n");
return -1;
}
result_end = strstr(result_start, ACTIVATION_RESPONSE_RESULT_END);
if ((result_start != NULL)
&& (result_end != NULL)) {
Expand All @@ -239,6 +243,10 @@ int activation_parse_data(char *response_data)
}

result_start = strstr(response_data, ACTIVATION_RESPONSE_MESSAGE_START);
if(result_start == NULL){
ACTIVATION_ERR("parse reponse result failed\n");
return -1;
}
result_end = strstr(result_start, ACTIVATION_RESPONSE_MESSAGE_END);
if ((result_start != NULL) && (result_end != NULL)) {
result_start += strlen(ACTIVATION_RESPONSE_MESSAGE_START);
Expand Down

0 comments on commit d7358cd

Please sign in to comment.