\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 204;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 204;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 209;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 209;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
}}\0";
free(resp_status->data);
resp_status->data = NULL;
- resp_status->data = strdup(status2);
- resp_status->code = 200;
resp_status->size = 209;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status2, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
will_return(mock_response, response_list[2]);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 204;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
response* resp = kds_s2000w_client_response_init();
{
response* resp_status = kds_s2000w_client_response_init();
const char* status = "{\"SessionId\":\"1251877821\"}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 27;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_open_session, 0);
response* set_option = kds_s2000w_client_response_init();
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 209;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
expect_function_call(__wrap_kds_s2000w_client_status_session);
\"PaperDetected\": \"0\", \
\"PercentAvailable\": 99 \
}}";
- resp_status->data = strdup(status);
- resp_status->code = 200;
resp_status->size = 204;
+ resp_status->data = malloc(resp_status->size);
+ memcpy(resp_status->data, status, resp_status->size);
+ resp_status->code = 200;
will_return(mock_response, resp_status);
will_return(__wrap_kds_s2000w_client_status_session, 0);
response* resp_session = kds_s2000w_client_response_init();
const char* responsedata = "{\"SessionId\":\"1251877821\"}";
- resp_session->data = strdup(responsedata);
- resp_session->code = 200;
resp_session->size = 27;
+ resp_session->data = malloc(resp_session->size);
+ memcpy(resp_session->data, responsedata, resp_session->size);
+ resp_session->code = 200;
will_return(mock_response, resp_session);
will_return(__wrap_kds_s2000w_client_open_session, 0);
response* resp_options = kds_s2000w_client_response_init();